/* ═══════════════════════════════════════════════════════════════════════════
   BARRIXA™ Advanced Sales Tool — Main Stylesheet
   Antilia Tec Pack | Precision Barrier Film Intelligence Platform
   Light theme with BARRIXA brand blue/teal gradients
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand Colors */
  --ultra-accent:  #e94560;
  --prime-accent:  #1a73e8;
  --pro-accent:    #7c3aed;
  --smart-accent:  #059669;

  /* Light Theme */
  --bg:            #f0f4f8;
  --bg-white:      #ffffff;
  --bg-card:       #ffffff;
  --bg-card2:      #f8fafc;
  --bg-section:    #eef2f7;
  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --text:          #1a1a2e;
  --text-muted:    #4a5568;
  --text-dim:      #8892a8;

  /* Status */
  --success:       #059669;
  --warning:       #d97706;
  --danger:        #dc2626;
  --info:          #1a73e8;

  /* Gradients */
  --grad-primary:  linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  --grad-ultra:    linear-gradient(135deg, #e94560 0%, #b91c3c 100%);
  --grad-prime:    linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  --grad-pro:      linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  --grad-smart:    linear-gradient(135deg, #059669 0%, #047857 100%);
  --grad-hero:     linear-gradient(135deg, #0d1b4b 0%, #1a3a7a 50%, #0f2d6b 100%);

  /* Radius */
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     18px;
  --radius-xl:     24px;

  /* Shadows */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-ultra:  0 4px 20px rgba(233,69,96,0.25);
  --shadow-prime:  0 4px 20px rgba(26,115,232,0.25);

  --transition:    all 0.22s cubic-bezier(0.4,0,0.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; font-size: 15px; }

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-card2); }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ─── HEADER ───────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px 24px; flex-wrap: wrap;
}
.brand-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--grad-ultra);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: #fff; letter-spacing: -1px;
  box-shadow: var(--shadow-ultra);
}
.brand-text { line-height: 1.2; }
.brand-name { font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--ultra-accent); }
.brand-sub  { font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }

.header-nav { display: flex; align-items: center; gap: 4px; }
.nav-tab {
  padding: 7px 14px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border: none; background: transparent;
  transition: var(--transition); letter-spacing: 0.3px;
}
.nav-tab:hover { color: var(--text); background: var(--bg-section); }
.nav-tab.active { color: var(--prime-accent); background: rgba(26,115,232,0.08); }

.header-meta { display: flex; align-items: center; gap: 8px; }
.meta-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-dim);
}
.meta-badge.live { color: var(--success); border-color: rgba(5,150,105,0.3); background: rgba(5,150,105,0.07); }

/* ─── HERO ───────────────────────────────────────────────────────────────── */
.hero {
  background: var(--grad-hero);
  padding: clamp(48px,7vw,96px) clamp(20px,4vw,48px) clamp(40px,5vw,72px);
  text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(233,69,96,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(26,115,232,0.15) 0%, transparent 60%);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: #93c5fd; margin-bottom: 20px;
  padding: 6px 16px; border-radius: 20px;
  border: 1px solid rgba(147,197,253,0.3); background: rgba(147,197,253,0.1);
  position: relative; z-index: 2;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 54px); font-weight: 900; line-height: 1.1;
  letter-spacing: -1.5px; margin-bottom: 18px; color: #fff; position: relative; z-index: 2;
}
.hero h1 .highlight {
  background: linear-gradient(90deg, #e94560, #f97316);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-desc {
  max-width: 640px; margin: 0 auto 32px; font-size: 17px;
  color: rgba(255,255,255,0.7); line-height: 1.7; position: relative; z-index: 2;
}
.variant-pills { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.variant-pill {
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px; border: 1px solid; cursor: default;
}
.pill-ultra  { color: #fca5a5; border-color: rgba(252,165,165,0.4);  background: rgba(252,165,165,0.12); }
.pill-prime  { color: #93c5fd; border-color: rgba(147,197,253,0.4); background: rgba(147,197,253,0.12); }
.pill-pro    { color: #c4b5fd; border-color: rgba(196,181,253,0.4); background: rgba(196,181,253,0.12); }
.pill-smart  { color: #6ee7b7; border-color: rgba(110,231,183,0.4); background: rgba(110,231,183,0.12); }

/* ─── TABS ────────────────────────────────────────────────────────────────── */
.page-tab { display: none; }
.page-tab.active { display: block; }

/* ─── MAIN WIZARD LAYOUT ──────────────────────────────────────────────── */
.wizard-layout {
  max-width: 1400px; margin: 0 auto;
  padding: clamp(20px,3vw,40px) clamp(16px,3vw,32px);
  display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start;
}

/* ─── INPUT PANEL ─────────────────────────────────────────────────────── */
.input-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; position: sticky; top: 78px;
  box-shadow: var(--shadow-md);
}
.panel-header {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
}
.panel-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.panel-header p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.panel-body { padding: 20px; }

.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 7px;
}
.form-label .required { color: var(--ultra-accent); margin-left: 2px; }

.form-select {
  width: 100%; background: var(--bg-card2); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 14px; font-family: inherit;
  padding: 11px 36px 11px 13px; cursor: pointer; transition: var(--transition);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.form-select:focus { outline: none; border-color: var(--prime-accent); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.form-select:disabled { opacity: 0.55; cursor: not-allowed; }

.shelf-life-display { display: flex; align-items: baseline; gap: 7px; margin-bottom: 10px; }
.shelf-life-number { font-size: 38px; font-weight: 900; color: var(--prime-accent); line-height: 1; font-variant-numeric: tabular-nums; }
.shelf-life-unit { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.shelf-life-label { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }

.range-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 5px;
  border-radius: 3px; background: #dde3ea; outline: none; cursor: pointer; transition: var(--transition);
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--grad-prime); cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(26,115,232,0.4); transition: var(--transition);
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-marks { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); margin-top: 5px; padding: 0 2px; }

.zone-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.zone-btn {
  padding: 11px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border);
  background: var(--bg-card2); color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 7px; justify-content: center;
}
.zone-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-section); }
.zone-btn.active-coastal  { background: rgba(26,115,232,0.08);  border-color: rgba(26,115,232,0.45);  color: var(--prime-accent); }
.zone-btn.active-inland   { background: rgba(124,58,237,0.08);  border-color: rgba(124,58,237,0.45);  color: var(--pro-accent); }
.zone-btn.active-panindia { background: rgba(233,69,96,0.08);   border-color: rgba(233,69,96,0.45);   color: var(--ultra-accent); }
.zone-btn.active-export   { background: rgba(5,150,105,0.08);   border-color: rgba(5,150,105,0.45);   color: var(--smart-accent); }
.zone-desc { font-size: 11px; color: var(--text-dim); margin-top: 7px; line-height: 1.6; }

.btn-analyze {
  width: 100%; padding: 13px 20px; border: none; border-radius: var(--radius-md);
  background: var(--grad-prime);
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow-prime); margin-top: 6px; letter-spacing: 0.3px;
}
.btn-analyze:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(26,115,232,0.4); }
.btn-analyze:active { transform: translateY(0); }
.btn-analyze:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-analyze--testing {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 4px 16px rgba(217,119,6,0.35);
}
.btn-analyze--testing:hover { box-shadow: 0 6px 24px rgba(217,119,6,0.45); }

/* ── Indian Mithai: Testing In Process result card ───────────────────────── */
.result-testing-card {
  background: var(--bg-card);
  border: 1.5px solid rgba(217,119,6,0.35);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.result-testing-icon {
  font-size: 52px;
  margin-bottom: 16px;
  line-height: 1;
}
.result-testing-title {
  font-size: 22px;
  font-weight: 900;
  color: #d97706;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.result-testing-product {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 5px 16px;
  background: rgba(217,119,6,0.07);
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: 20px;
  display: inline-block;
}
.result-testing-body {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 24px;
}
.result-testing-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto 24px;
  text-align: left;
}
.result-testing-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(217,119,6,0.05);
  border: 1px solid rgba(217,119,6,0.15);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.rti-icon { font-size: 16px; flex-shrink: 0; }
.result-testing-footer {
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 16px;
  background: var(--bg-section);
  border-radius: 10px;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── OUTPUT AREA ────────────────────────────────────────────────────────── */
.output-area { display: flex; flex-direction: column; gap: 20px; }

/* ─── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 56px 28px; text-align: center;
  box-shadow: var(--shadow-md);
}
.empty-icon { font-size: 52px; margin-bottom: 18px; opacity: 0.5; }
.empty-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-desc { color: var(--text-muted); max-width: 400px; margin: 0 auto 22px; font-size: 14px; }
.empty-steps { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.empty-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad-prime); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── RESULT CARD ───────────────────────────────────────────────────────── */
.result-card { border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

.variant-hero { padding: 28px 28px 24px; position: relative; overflow: hidden; }
.variant-hero::before {
  content: ''; position: absolute; inset: 0; opacity: 0.05;
  background: repeating-linear-gradient(45deg, transparent, transparent 16px, #fff 16px, #fff 17px);
}
.vh-ultra  { background: linear-gradient(135deg, #3d0519 0%, #6b0f2a 50%, #2d0010 100%); }
.vh-prime  { background: linear-gradient(135deg, #0d1b4b 0%, #1a3470 50%, #071430 100%); }
.vh-pro    { background: linear-gradient(135deg, #2d1470 0%, #4a1d96 50%, #1e0b55 100%); }
.vh-smart  { background: linear-gradient(135deg, #064e2c 0%, #065f3f 50%, #023320 100%); }

.vh-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-bottom: 22px; position: relative; z-index: 2;
}
.vh-variant-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 20px; border: 1px solid; margin-bottom: 7px;
}
.vh-name { font-size: clamp(24px,4vw,38px); font-weight: 900; line-height: 1.1; letter-spacing: -1px; color: #fff; }
.vh-tagline { font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 500; margin-top: 3px; }

.vh-specs { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 2; }
.vh-spec {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm); padding: 10px 14px; flex: 1; min-width: 110px;
}
.vh-spec-label { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.45); margin-bottom: 4px; }
.vh-spec-val { font-size: 18px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.vh-spec-sub { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
/* Admin-only spec card — subtle gold border to distinguish */
.vh-spec--admin-only { border-color: rgba(217,119,6,0.45) !important; background: rgba(217,119,6,0.10) !important; }
.admin-eye { font-size: 10px; opacity: 0.7; vertical-align: middle; margin-left: 3px; }

.vh-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  position: relative; z-index: 2; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.vh-meta-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255,255,255,0.55); }

.accent-ultra { color: #fca5a5; border-color: rgba(252,165,165,0.4); }
.accent-prime { color: #93c5fd; border-color: rgba(147,197,253,0.4); }
.accent-pro   { color: #c4b5fd; border-color: rgba(196,181,253,0.4); }
.accent-smart { color: #6ee7b7; border-color: rgba(110,231,183,0.4); }

.result-details { background: var(--bg-card); padding: 22px; border-top: 1px solid var(--border); }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.detail-block {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.detail-block-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 7px;
}
.detail-block-content { font-size: 13px; line-height: 1.7; color: var(--text-muted); }

.spoilage-rank { list-style: none; padding: 0; }
.spoilage-rank li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 5px;
}
.rank-num {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg-section);
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-1 .rank-num { background: rgba(220,38,38,0.1);  color: var(--danger); }
.rank-2 .rank-num { background: rgba(217,119,6,0.1);  color: var(--warning); }
.rank-3 .rank-num { background: rgba(5,150,105,0.1); color: var(--success); }

.packaging-notes {
  background: rgba(26,115,232,0.05); border: 1px solid rgba(26,115,232,0.2);
  border-radius: var(--radius-md); padding: 13px 16px; margin-bottom: 14px;
}
.packaging-notes-title { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--prime-accent); margin-bottom: 7px; }
.note-list { list-style: none; padding: 0; }
.note-list li { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.note-list li::before { content: '→'; color: var(--prime-accent); flex-shrink: 0; }

.zone-comparison {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 14px;
}
.zone-comparison-title { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; }
.zone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zone-block { background: var(--bg-card); border-radius: var(--radius-sm); padding: 10px 13px; border: 1.5px solid transparent; }
.zone-block.active { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.zone-block-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
.label-coastal { color: var(--prime-accent); }
.label-inland  { color: var(--pro-accent); }
.zone-variant-name { font-size: 14px; font-weight: 700; color: var(--text); }
.zone-variant-note { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.zone-note-text { font-size: 12px; color: var(--text-muted); margin-top: 7px; line-height: 1.6; grid-column: 1 / -1; }

.justification-block {
  background: rgba(233,69,96,0.04); border: 1px solid rgba(233,69,96,0.18);
  border-left: 3px solid var(--ultra-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 13px 16px; margin-bottom: 14px;
}
.justification-block p { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.justification-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ultra-accent); margin-bottom: 5px; }

.max-warning {
  background: rgba(217,119,6,0.07); border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--radius-md); padding: 13px 16px; margin-bottom: 14px; display: flex; gap: 10px;
}
.max-warning-icon { font-size: 18px; flex-shrink: 0; }
.max-warning-text { font-size: 13px; color: #92400e; line-height: 1.7; }

.sources-block {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 11px 14px;
}
.sources-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 7px; }
.sources-list { display: flex; flex-wrap: wrap; gap: 5px; }
.source-chip {
  font-size: 11px; color: var(--text-dim);
  background: var(--bg-section); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 8px;
}

/* ─── DISCLAIMER CARD ────────────────────────────────────────────────── */
.disclaimer-card {
  background: rgba(220,38,38,0.04); border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-lg); padding: 18px 22px; display: flex; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.disclaimer-icon { font-size: 22px; flex-shrink: 0; padding-top: 2px; }
.disclaimer-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--danger); margin-bottom: 7px; }
.disclaimer-text { font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.disclaimer-text strong { color: var(--danger); }

/* ─── QUICK REFERENCE ──────────────────────────────────────────────────── */
.quick-ref {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md);
}
.section-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
}
.section-header h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.section-header p  { font-size: 12px; color: var(--text-muted); }

.variant-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.variant-card {
  padding: 18px; border-right: 1px solid var(--border); transition: var(--transition);
}
.variant-card:last-child { border-right: none; }
.variant-card:hover { background: var(--bg-section); }
.vc-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 10px; border: 1px solid; display: inline-block; margin-bottom: 8px;
}
.vc-name { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.vc-tagline { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.vc-specs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.vc-spec-item { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: var(--bg-section); color: var(--text-muted); border: 1px solid var(--border); }
.vc-ideal { font-size: 11px; color: var(--text-dim); line-height: 1.6; }
.vc-ideal span { display: block; margin-bottom: 2px; }
.vc-ideal span::before { content: '• '; }

/* ─── EXAMPLES ──────────────────────────────────────────────────────── */
.examples-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md);
}
.example-list { padding: 8px 10px 14px; }
.example-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition); border: 1px solid transparent;
}
.example-item:hover { background: var(--bg-section); border-color: var(--border); }
.example-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.example-text { font-size: 13px; color: var(--text-muted); flex: 1; }
.example-text strong { color: var(--text); font-weight: 600; }
.example-arrow { font-size: 11px; color: var(--text-dim); font-weight: 600; }

/* ─── ANALYZING ────────────────────────────────────────────────────────── */
.analyzing-overlay {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 40px; color: var(--text-muted); font-size: 14px; background: var(--bg-card);
  border-radius: var(--radius-xl); border: 1px solid var(--border);
}
.spin-dots { display: flex; gap: 5px; }
.spin-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--prime-accent); animation: pulse-dot 1.2s ease-in-out infinite; }
.spin-dot:nth-child(2) { animation-delay: 0.2s; }
.spin-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── CHARTS TAB ───────────────────────────────────────────────────────── */
.charts-layout {
  max-width: 1400px; margin: 0 auto;
  padding: clamp(20px,3vw,40px) clamp(16px,3vw,32px);
}
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md);
}
.chart-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
}
.chart-header h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.chart-header p  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.chart-body { padding: 20px; }
.chart-container { position: relative; height: 300px; }
.chart-full { grid-column: 1 / -1; }

/* Application Matrix */
.app-matrix { overflow-x: auto; }
.app-matrix table { width: 100%; border-collapse: collapse; font-size: 12px; }
.app-matrix th {
  background: var(--bg-section); padding: 10px 14px; text-align: left;
  font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted);
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.app-matrix td {
  padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
  color: var(--text-muted);
}
.app-matrix tr:last-child td { border-bottom: none; }
.app-matrix tr:hover td { background: var(--bg-section); }
.matrix-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  border: 1px solid;
}
.badge-ultra  { color: var(--ultra-accent); border-color: rgba(233,69,96,0.3);  background: rgba(233,69,96,0.08); }
.badge-prime  { color: var(--prime-accent); border-color: rgba(26,115,232,0.3); background: rgba(26,115,232,0.08); }
.badge-pro    { color: var(--pro-accent);   border-color: rgba(124,58,237,0.3); background: rgba(124,58,237,0.08); }
.badge-smart  { color: var(--smart-accent); border-color: rgba(5,150,105,0.3);  background: rgba(5,150,105,0.08); }

/* ── Indian Mithai: Testing badge (SKU table) ─────────────────────────────── */
.badge-testing {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 10px; font-size: 11px; font-weight: 700;
  color: #d97706;
  background: rgba(217,119,6,0.10);
  border: 1px solid rgba(217,119,6,0.30);
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-testing-sm {
  font-size: 12px; color: #d97706; font-weight: 700;
}
.row-mithai-testing td { opacity: 0.82; }
.row-mithai-testing:hover td { opacity: 1; }

/* ── Indian Mithai: Testing notice (Wizard Step 3) ───────────────────────── */
.mithai-testing-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(217,119,6,0.08) 0%, rgba(217,119,6,0.04) 100%);
  border: 1.5px solid rgba(217,119,6,0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.mithai-testing-icon {
  font-size: 22px; flex-shrink: 0; margin-top: 1px;
}
.mithai-testing-title {
  font-size: 13px; font-weight: 800; color: #d97706;
  margin-bottom: 4px;
}
.mithai-testing-sub {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.55;
}

/* ── Shelf-life group: disabled state for Indian Mithai ──────────────────── */
.shelf-disabled .range-slider {
  cursor: not-allowed;
  opacity: 0.35;
  pointer-events: none;
}
.shelf-disabled .shelf-life-number {
  color: var(--text-dim);
}
.shelf-disabled .shelf-life-display {
  opacity: 0.40;
}

/* ─── ROI TAB ──────────────────────────────────────────────────────────── */
.roi-layout {
  max-width: 1200px; margin: 0 auto;
  padding: clamp(20px,3vw,40px) clamp(16px,3vw,32px);
}
.roi-grid { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
.roi-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; position: sticky; top: 78px;
  box-shadow: var(--shadow-md);
}
.roi-result-area { display: flex; flex-direction: column; gap: 20px; }

.roi-input { margin-bottom: 16px; }
.roi-input label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.roi-input input, .roi-input select {
  width: 100%; background: var(--bg-card2); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 14px; font-family: inherit;
  padding: 10px 13px; transition: var(--transition);
}
.roi-input input:focus, .roi-input select:focus { outline: none; border-color: var(--prime-accent); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.roi-input .unit-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.btn-calc {
  width: 100%; padding: 13px 20px; border: none; border-radius: var(--radius-md);
  background: var(--grad-smart); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: var(--transition); box-shadow: 0 4px 16px rgba(5,150,105,0.35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(5,150,105,0.45); }

.roi-metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.roi-metric {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.roi-metric-val { font-size: 28px; font-weight: 900; line-height: 1.1; margin-bottom: 4px; }
.roi-metric-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.roi-metric-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.metric-positive { color: var(--success); }
.metric-warning  { color: var(--warning); }
.metric-info     { color: var(--info); }

.roi-chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md);
}
.roi-chart-body { padding: 20px; }
.roi-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.roi-table th { background: var(--bg-section); padding: 9px 14px; text-align: left; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.roi-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.roi-table tr:last-child td { border-bottom: none; }
.roi-table tr:hover td { background: var(--bg-section); }

/* ─── SKU DATABASE TAB ──────────────────────────────────────────────────── */
.sku-layout {
  max-width: 1400px; margin: 0 auto;
  padding: clamp(20px,3vw,40px) clamp(16px,3vw,32px);
}

/* ─── DB EXPORT / IMPORT PANEL ──────────────────────────────────────────── */
.db-io-panel {
  display: flex; align-items: flex-start; gap: 0;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-xl); margin-bottom: 20px;
  box-shadow: var(--shadow-md); overflow: hidden;
}
.db-io-left, .db-io-right {
  flex: 1; padding: 20px 24px;
}
.db-io-left  { border-right: 1px solid var(--border); }
.db-io-divider { display: none; }
.db-io-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  margin-bottom: 6px; letter-spacing: 0.01em;
}
.db-io-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
  margin-bottom: 14px;
}
.btn-export {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius-md);
  background: var(--prime-accent); color: #fff;
  font-size: 13px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 8px rgba(26,115,232,0.18);
}
.btn-export:hover { background: #1558c0; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,115,232,0.28); }
.btn-import-label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius-md);
  background: #059669; color: #fff;
  font-size: 13px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 8px rgba(5,150,105,0.18);
}
.btn-import-label:hover { background: #047857; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(5,150,105,0.28); }
.import-status {
  margin-top: 10px; font-size: 12px; font-weight: 600;
  line-height: 1.5; min-height: 18px;
}
.import-status.importing { color: var(--text-muted); }
.import-status.success   { color: #059669; }
.import-status.error     { color: var(--danger); }

@media (max-width: 700px) {
  .db-io-panel { flex-direction: column; }
  .db-io-left  { border-right: none; border-bottom: 1px solid var(--border); }
}

  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 20px 22px; margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.sku-filters-header { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.sku-filters-grid { display: grid; grid-template-columns: 1fr 200px 200px 200px auto; gap: 12px; align-items: end; }
.filter-group label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.filter-input, .filter-select {
  width: 100%; background: var(--bg-card2); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 13px; font-family: inherit;
  padding: 10px 13px; transition: var(--transition);
}
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--prime-accent); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.filter-select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.btn-reset {
  padding: 10px 18px; border-radius: var(--radius-md); border: 1.5px solid var(--border);
  background: var(--bg-card2); color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-reset:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-section); }

.sku-stats {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: center;
}
.sku-count { font-size: 13px; color: var(--text-muted); }
.sku-count strong { color: var(--prime-accent); font-weight: 700; }

.sku-table-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-md);
}
.sku-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sku-table th {
  background: var(--bg-section); padding: 11px 14px; text-align: left;
  font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted);
  border-bottom: 2px solid var(--border); white-space: nowrap; font-size: 11px;
  cursor: pointer; user-select: none;
}
.sku-table th:hover { color: var(--prime-accent); }
.sku-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.sku-table tr:last-child td { border-bottom: none; }
.sku-table tr:hover td { background: var(--bg-section); }
.sku-product-name { font-weight: 600; color: var(--text); font-size: 13px; }
.sku-category { color: var(--text-dim); font-size: 11px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px; border-top: 1px solid var(--border); }
.page-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-card2); color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--prime-accent); color: var(--prime-accent); background: rgba(26,115,232,0.06); }
.page-btn.active { background: var(--prime-accent); color: #fff; border-color: var(--prime-accent); }
.page-info { font-size: 12px; color: var(--text-dim); padding: 0 8px; }

/* ─── FOOTER ──────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 22px clamp(16px,4vw,48px);
  text-align: center; background: var(--bg-card); margin-top: 40px;
}
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-text { font-size: 12px; color: var(--text-dim); line-height: 1.8; }
.footer-copyright {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 13px;
  font-weight: 700;
  color: #FF6B2B;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ─── TOOLTIP / INFO ───────────────────────────────────────────────────── */
.info-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: var(--bg-section); border: 1px solid var(--border); color: var(--text-muted);
}

/* ─── UTILITY ──────────────────────────────────────────────────────────── */
.text-ultra  { color: var(--ultra-accent); }
.text-prime  { color: var(--prime-accent); }
.text-pro    { color: var(--pro-accent); }
.text-smart  { color: var(--smart-accent); }

/* ─── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .wizard-layout { grid-template-columns: 360px 1fr; }
  .roi-grid { grid-template-columns: 360px 1fr; }
}
@media (max-width: 900px) {
  .wizard-layout, .roi-grid { grid-template-columns: 1fr; }
  .input-panel, .roi-panel { position: static; }
  .variant-cards { grid-template-columns: repeat(2, 1fr); }
  .variant-card { border-bottom: 1px solid var(--border); }
  .variant-card:nth-child(odd)  { border-right: 1px solid var(--border); }
  .variant-card:nth-child(even) { border-right: none; }
  .variant-card:nth-last-child(-n+2) { border-bottom: none; }
  .charts-grid { grid-template-columns: 1fr; }
  .sku-filters-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .variant-cards { grid-template-columns: 1fr; }
  .variant-card:nth-child(odd) { border-right: none; }
  .variant-card:last-child { border-bottom: none; }
  .zone-grid, .detail-grid { grid-template-columns: 1fr; }
  .vh-specs { flex-direction: column; }
  .header-nav { display: none; }
  .header-meta { display: none; }
  .sku-filters-grid { grid-template-columns: 1fr; }
  .roi-metrics-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH GATE — Full-screen sign-in overlay
   ═══════════════════════════════════════════════════════════════════════════ */

/* While Firebase resolves auth state, hide the app body to avoid flash */
body.auth-pending .site-header,
body.auth-pending .hero,
body.auth-pending .page-tab,
body.auth-pending .site-footer {
  visibility: hidden;
  pointer-events: none;
}

/* Once signed in, app is visible */
body.auth-ready .site-header,
body.auth-ready .hero,
body.auth-ready .page-tab,
body.auth-ready .site-footer {
  visibility: visible;
  pointer-events: auto;
}

/* ── Gate overlay ─────────────────────────────────────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f1626 0%, #1a2540 50%, #0d1b35 100%);
  padding: 24px;
  transition: opacity 0.38s ease;
}

.auth-gate--hiding {
  opacity: 0;
  pointer-events: none;
}

/* ── Floating background circles ─────────────────────────────────────────── */
.auth-bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  animation: authFloat var(--dur,18s) ease-in-out infinite;
  pointer-events: none;
}
@keyframes authFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-22px) rotate(180deg); }
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.auth-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 44px 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow:
    0 32px 80px rgba(0,0,0,0.35),
    0 8px 24px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.06);
  text-align: center;
  animation: authCardIn 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  z-index: 1;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Brand icon shimmer ───────────────────────────────────────────────────── */
.auth-brand-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(255,255,255,0.35) 50%,
    transparent 70%);
  transform: translateX(-100%);
  animation: authShimmer 3.5s ease-in-out infinite;
}
@keyframes authShimmer {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ── Google button ripple ─────────────────────────────────────────────────── */
.btn-google-auth {
  position: relative;
  overflow: hidden;
}
.btn-google-auth::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(26,115,232,0.18);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: width 0.55s ease, height 0.55s ease, opacity 0.55s ease;
  opacity: 0;
}
.btn-google-auth:active::after {
  width: 320px; height: 320px;
  opacity: 1;
}

/* ── Feature pill stagger entrance ───────────────────────────────────────── */
.auth-feat {
  animation: authFeatIn 0.4s ease both;
}
.auth-feat:nth-child(1) { animation-delay: 0.25s; }
.auth-feat:nth-child(2) { animation-delay: 0.35s; }
.auth-feat:nth-child(3) { animation-delay: 0.45s; }
.auth-feat:nth-child(4) { animation-delay: 0.55s; }
@keyframes authFeatIn {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Error shake ──────────────────────────────────────────────────────────── */
.auth-shake {
  animation: authShake 0.42s ease !important;
}
@keyframes authShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  60%      { transform: translateX(8px); }
  80%      { transform: translateX(-4px); }
}

/* ── Tab slide indicator ──────────────────────────────────────────────────── */
@keyframes authTabSlide {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Logo block ───────────────────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e94560, #1a73e8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(26,115,232,0.35);
  position: relative;   /* shimmer needs positioning context */
  overflow: hidden;      /* clip shimmer sweep to icon bounds */
}

.auth-brand-text {
  text-align: left;
}

.auth-brand-name {
  font-size: 22px;
  font-weight: 900;
  color: #1a1a2e;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.auth-brand-sub {
  font-size: 12px;
  color: #8892a8;
  font-weight: 500;
  margin-top: 1px;
}

/* ── Headline & description ───────────────────────────────────────────────── */
.auth-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 10px;
  line-height: 1.3;
}

.auth-desc {
  font-size: 14px;
  color: #4a5568;
  line-height: 1.6;
  margin: 0 0 22px;
}

/* ── Feature pills ────────────────────────────────────────────────────────── */
.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.auth-feat {
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  background: rgba(26,115,232,0.08);
  border: 1px solid rgba(26,115,232,0.18);
  border-radius: 20px;
  padding: 5px 12px;
  white-space: nowrap;
}

/* ── Google icon (shared by all auth buttons) ────────────────────────────── */
.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Spin keyframe (used by .btn-spinner) ─────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER USER BAR — shown after sign-in
   ═══════════════════════════════════════════════════════════════════════════ */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(26,115,232,0.07);
  border: 1px solid rgba(26,115,232,0.18);
  border-radius: 24px;
  padding: 4px 4px 4px 8px;
  animation: fadeInUser 0.3s ease both;
}

@keyframes fadeInUser {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(26,115,232,0.35);
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-signout {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 18px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.btn-signout:hover {
  background: rgba(233,69,96,0.10);
  border-color: rgba(233,69,96,0.35);
  color: #e94560;
}

/* ── Auth card — wider for tabbed layout ──────────────────────────────────── */
.auth-card {
  max-width: 520px;  /* override previous 480px */
}

/* ══ AUTH TABS ═══════════════════════════════════════════════════════════════ */
.auth-tabs {
  display: flex;
  background: #f0f4f8;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.auth-tab-btn {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  background: transparent;
  color: #8892a8;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: #1a1a2e;
  box-shadow: 0 1px 6px rgba(0,0,0,0.10);
}

.auth-tab-btn:hover:not(.active) {
  color: #4a5568;
}

/* ══ AUTH PANEL ══════════════════════════════════════════════════════════════ */
.auth-panel {
  text-align: left;
}

.auth-panel.hidden {
  display: none;
}

/* ══ GOOGLE BUTTON (new unified class) ═══════════════════════════════════════ */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 20px;
  border: 1.5px solid #dadce0;
  border-radius: 10px;
  background: #ffffff;
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-bottom: 16px;
}

.btn-google-auth:hover {
  background: #f8f9fa;
  border-color: #4285F4;
  box-shadow: 0 3px 12px rgba(66,133,244,0.20);
  transform: translateY(-1px);
}

.btn-google-auth:active  { transform: translateY(0); }
.btn-google-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26,115,232,0.25);
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ══ DIVIDER (kept for potential future use) ═══════════════════════════════ */
.auth-divider { display: none; }

/* ══ OTP INPUT FIELDS ════════════════════════════════════════════════════════ */
.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.auth-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #dde3ea;
  border-radius: 9px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1a1a2e;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-input:focus {
  border-color: #1a73e8;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.10);
}

.auth-input::placeholder { color: #a0aec0; }

/* OTP digit input — larger, centred */
.otp-input {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  padding: 13px 14px;
}

/* ══ PRIMARY AUTH BUTTON ══════════════════════════════════════════════════════ */
.btn-auth-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(26,115,232,0.30);
  margin-bottom: 10px;
}

.btn-auth-primary:hover {
  background: #1557b0;
  box-shadow: 0 4px 14px rgba(26,115,232,0.38);
  transform: translateY(-1px);
}

.btn-auth-primary:active  { transform: translateY(0); }
.btn-auth-primary:disabled {
  background: #a0aec0;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ══ LINK BUTTON ═════════════════════════════════════════════════════════════ */
.btn-auth-link {
  background: none;
  border: none;
  color: #8892a8;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  padding: 4px 0;
  display: block;
  width: 100%;
  text-align: center;
  transition: color 0.15s;
  margin-bottom: 10px;
}

.btn-auth-link:hover { color: #1a73e8; }

/* ══ OTP DISPLAY BOX ═════════════════════════════════════════════════════════ */
.otp-display-wrap {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
  border: 2px solid #1a73e8;
  border-radius: 14px;
  padding: 18px 20px 14px;
  margin-bottom: 16px;
  text-align: center;
}
.otp-display-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a73e8;
  margin-bottom: 8px;
}
.otp-display-code {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 12px;
  color: #1a1a2e;
  font-family: 'Courier New', monospace;
  line-height: 1;
  margin-bottom: 8px;
  user-select: all;
  cursor: pointer;
  padding: 4px 0;
}
.otp-display-note {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

/* ══ OTP SENT NOTE ═══════════════════════════════════════════════════════════ */
.otp-sent-note {
  font-size: 13px;
  color: #4a5568;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(5,150,105,0.06);
  border: 1px solid rgba(5,150,105,0.15);
  border-radius: 8px;
  line-height: 1.6;
}

/* ══ OTP RESEND ROW (legacy — hidden) ═══════════════════════════════════════ */
.otp-resend-row { display: none; }

/* ══ AUTH MESSAGE (error / info) ═════════════════════════════════════════════ */
.auth-msg {
  font-size: 13px;
  font-weight: 500;
  padding: 11px 14px;
  border-radius: 9px;
  margin-bottom: 14px;
  line-height: 1.5;
  text-align: left;
}

.auth-msg--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.auth-msg--info {
  background: rgba(26,115,232,0.07);
  border: 1px solid rgba(26,115,232,0.18);
  color: #1a73e8;
}

.auth-msg--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #059669;
  font-weight: 600;
}

/* ══ PROFILE FORM CARD (post-Google sign-up overlay) ════════════════════════ */
.profile-form-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 36px 28px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 8px 24px rgba(0,0,0,0.12);
  animation: pfSlideIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes pfSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}
.pf-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.pf-icon {
  font-size: 32px;
  flex-shrink: 0;
}
.pf-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.2;
}
.pf-sub {
  font-size: 12.5px;
  color: #8892a8;
  margin-top: 2px;
}
.pf-google-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.pf-google-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8892a8;
  white-space: nowrap;
  flex-shrink: 0;
}
.pf-google-email {
  font-size: 13px;
  font-weight: 600;
  color: #1a73e8;
  word-break: break-all;
}
/* Scrollbar styling for the card */
.profile-form-card::-webkit-scrollbar { width: 4px; }
.profile-form-card::-webkit-scrollbar-track { background: transparent; }
.profile-form-card::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ══ FOOTER NOTE (inside panels) ═════════════════════════════════════════════ */
.auth-footer-note {
  font-size: 12px;
  color: #8892a8;
  line-height: 1.6;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid #eef2f7;
  text-align: center;
}

.auth-footer-note a {
  color: #1a73e8;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer-note a:hover { text-decoration: underline; }

/* ══ REPORT UPLOAD PANEL ════════════════════════════════════════════════════ */

/* Floating upload FAB button in chatbot header */
.chat-upload-fab-btn {
  background: rgba(26,115,232,0.15);
  border: 1.5px solid rgba(26,115,232,0.35);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 6px 10px;
  line-height: 1;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}
.chat-upload-fab-btn:hover {
  background: rgba(26,115,232,0.30);
  border-color: rgba(26,115,232,0.65);
  transform: scale(1.08);
}

/* Full-screen backdrop overlay */
#report-upload-panel {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(10,20,50,0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: upPanelIn 0.22s ease both;
}
@keyframes upPanelIn {
  from { opacity:0; transform: scale(0.96) translateY(12px); }
  to   { opacity:1; transform: scale(1)    translateY(0); }
}

/* The white card */
.upload-panel-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 4px 16px rgba(26,115,232,0.10);
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: pfSlideIn 0.28s cubic-bezier(0.34,1.56,0.64,1) both;
}
.upload-panel-card::-webkit-scrollbar { width: 4px; }
.upload-panel-card::-webkit-scrollbar-track { background: transparent; }
.upload-panel-card::-webkit-scrollbar-thumb { background: #d1d9e8; border-radius: 4px; }

/* Header strip */
.upload-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #eef2f7;
  background: linear-gradient(135deg, #f0f6ff 0%, #e8f0fe 100%);
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}
.upload-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
}
.upload-panel-sub {
  font-size: 12px;
  color: #6b7a99;
  margin-top: 3px;
  font-weight: 500;
}
.upload-panel-close {
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 8px;
  color: #4a5568;
  cursor: pointer;
  font-size: 20px;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.upload-panel-close:hover {
  background: rgba(220,38,38,0.10);
  color: #dc2626;
}

/* Form body */
.upload-panel-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Individual field group */
.upload-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.upload-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a5568;
}
.upload-label .req-star {
  color: #dc2626;
  margin-left: 2px;
}
.upload-input {
  border: 1.5px solid #d1d9e8;
  border-radius: 9px;
  color: #1a1a2e;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  padding: 9px 13px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  width: 100%;
  background: #fdfdff;
}
.upload-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
  background: #fff;
}
.upload-input::placeholder { color: #b0bac9; }

/* Two-column row */
.upload-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .upload-row-2col { grid-template-columns: 1fr; }
}

/* File drop zone */
.upload-dropzone {
  border: 2px dashed #c0cce0;
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  background: #f8fbff;
  position: relative;
  overflow: hidden;
}
.upload-dropzone:hover,
.upload-dropzone.drag-over {
  border-color: #1a73e8;
  background: #edf4fe;
}
.upload-dropzone.has-file {
  border-color: #059669;
  background: #f0fdf6;
}
.upload-dropzone-inner {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.upload-dropzone-icon {
  font-size: 32px;
  line-height: 1;
  opacity: 0.8;
}
.upload-dropzone-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #2d3748;
}
.upload-dropzone-sub {
  font-size: 11.5px;
  color: #8892a8;
}
.upload-file-name {
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  margin-top: 6px;
  word-break: break-all;
  display: none;
}
.upload-file-name.visible { display: block; }

/* Hidden real file input inside dropzone */
.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Submit button */
.upload-submit-btn {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  border: none;
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 24px;
  width: 100%;
  text-align: center;
  transition: opacity 0.18s, transform 0.15s, box-shadow 0.18s;
  box-shadow: 0 4px 14px rgba(26,115,232,0.32);
  letter-spacing: 0.02em;
  margin-top: 4px;
}
.upload-submit-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,115,232,0.38);
}
.upload-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Success state */
#upload-success-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 24px 40px;
  text-align: center;
}
.upload-success-icon {
  font-size: 52px;
  line-height: 1;
  animation: successBounce 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes successBounce {
  from { transform: scale(0.5); opacity:0; }
  to   { transform: scale(1);   opacity:1; }
}
.upload-success-title {
  font-size: 18px;
  font-weight: 700;
  color: #059669;
}
.upload-success-msg {
  font-size: 13px;
  color: #4a5568;
  line-height: 1.6;
  max-width: 340px;
}
.upload-success-close-btn {
  background: #059669;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 28px;
  transition: opacity 0.15s;
}
.upload-success-close-btn:hover { opacity: 0.88; }

/* ═══════════════════════════════════════════════════════════════════════════
   SELF-LEARNING CHATBOT UI — v4.0
   Feedback row · Teach box · Confidence badge · Source tag
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Feedback row wrapper (appended below every bot bubble) ───────────────── */
.learn-feedback-row {
  padding: 8px 10px 6px;
  background: #f8fafd;
  border-top: 1px solid #e8eef6;
  border-radius: 0 0 14px 14px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  animation: learnFadeIn 0.25s ease;
}
@keyframes learnFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Meta row — source tag + confidence badge ─────────────────────────────── */
.learn-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 18px;
}

/* ── Button row ───────────────────────────────────────────────────────────── */
.learn-btn-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.learn-label {
  font-size: 11px;
  color: #7b8fa8;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Thumbs up / down buttons ─────────────────────────────────────────────── */
.learn-btn {
  background: none;
  border: 1.5px solid #d1d9e8;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 8px;
  line-height: 1.6;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  user-select: none;
}
.learn-btn:hover { transform: scale(1.18); }
.learn-btn--up:hover   { background: #dcfce7; border-color: #059669; }
.learn-btn--down:hover { background: #fee2e2; border-color: #dc2626; }
.learn-btn:disabled    { opacity: 0.4; cursor: default; transform: none; }

/* ── Thanks message after rating ─────────────────────────────────────────── */
.learn-thanks {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #059669;
  border: 1px solid #bbf7d0;
}
.learn-thanks--up { color: #059669; }

/* ── Confidence badge ────────────────────────────────────────────────────── */
.learn-conf-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.7);
  border: 1px solid currentColor;
  opacity: 0.9;
}

/* ── Memory badge ─────────────────────────────────────────────────────────── */
.learn-mem-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: #7c3aed;
  background: #f3f0ff;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  padding: 2px 7px;
}

/* ── Source tags ──────────────────────────────────────────────────────────── */
.learn-src-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.learn-src-tag--db     { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.learn-src-tag--mem    { background: #f3f0ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.learn-src-tag--tfidf  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.learn-src-tag--taught { background: #fff7ed; color: #b45309; border: 1px solid #fcd34d; }
.learn-src-tag--fb     { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.learn-src-tag--comp   { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; } /* competitor intel */
.learn-src-tag--sci    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; } /* food science */

/* ── Teach box (appears when bot can't answer) ────────────────────────────── */
.learn-teach-box {
  margin-top: 4px;
  background: #fff8f0;
  border: 1.5px dashed #f59e0b;
  border-radius: 12px;
  padding: 12px 14px 10px;
  animation: learnFadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.learn-teach-prompt {
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.45;
}

.learn-teach-input {
  width: 100%;
  border: 1.5px solid #fcd34d;
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12.5px;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
  resize: vertical;
  background: #fffbf0;
  color: #1a2a3a;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.learn-teach-input:focus {
  outline: none;
  border-color: #f59e0b;
  background: #fff;
}

.learn-teach-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.learn-teach-submit {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.15s, transform 0.12s;
}
.learn-teach-submit:hover    { opacity: 0.9; transform: translateY(-1px); }
.learn-teach-submit:disabled { opacity: 0.4; cursor: default; transform: none; }

.learn-teach-skip {
  background: none;
  border: 1.5px solid #d1d9e8;
  border-radius: 8px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.learn-teach-skip:hover { background: #f1f5f9; }

.learn-teach-status {
  font-size: 12px;
  color: #059669;
  font-weight: 600;
  padding: 4px 2px;
  line-height: 1.4;
}

/* ── Memory count badge in chat header (optional) ─────────────────────────── */
.learn-memory-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  background: #f3f0ff;
  border: 1px solid #ddd6fe;
  border-radius: 5px;
  padding: 2px 7px;
  cursor: default;
}

/* ══ HIDDEN UTILITY ══════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ══ ADMIN LINK IN HEADER ════════════════════════════════════════════════════ */
.btn-admin-link {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(124,58,237,0.18);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 8px;
  padding: 5px 12px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  align-items: center;
  gap: 4px;
}

.btn-admin-link:hover {
  background: rgba(124,58,237,0.32);
  color: #fff;
}

/* ── Auth gate responsive ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .auth-card {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }
  .auth-brand-name { font-size: 19px; }
  .auth-features { gap: 6px; }
  .auth-feat { font-size: 11px; padding: 4px 10px; }
  .otp-input { font-size: 18px; letter-spacing: 7px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIGN-UP FORM ENHANCEMENTS — Name / Company / Phone / Privacy
   ═══════════════════════════════════════════════════════════════════════════ */

/* Required field asterisk */
.req-star {
  color: var(--danger);
  font-weight: 700;
  margin-left: 2px;
}

/* Privacy checkbox row */
.privacy-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 6px 0 14px;
  padding: 12px 14px;
  background: #f0f7ff;
  border: 1.5px solid rgba(26,115,232,0.18);
  border-radius: 9px;
  transition: border-color 0.2s;
}
.privacy-checkbox-row:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.08);
}
.privacy-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #4a5568;
  line-height: 1.45;
  width: 100%;
}
/* Hide native checkbox */
.privacy-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
/* Custom checkbox */
.privacy-check-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 2px solid #c3cfe2;
  border-radius: 5px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.privacy-checkbox:checked + .privacy-check-custom {
  background: #1a73e8;
  border-color: #1a73e8;
}
.privacy-checkbox:checked + .privacy-check-custom::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.privacy-text { flex: 1; }
.privacy-link {
  color: #1a73e8;
  font-weight: 600;
  text-decoration: none;
}
.privacy-link:hover { text-decoration: underline; }

/* Shake animation on unchecked submit */
@keyframes privacyShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.privacy-shake { animation: privacyShake 0.55s ease; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRIVACY MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.52);
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.privacy-modal-overlay.hidden { display: none !important; }
.privacy-modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 72px rgba(0,0,0,0.28);
  overflow: hidden;
  animation: modalIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { transform: scale(0.90) translateY(12px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}
.privacy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.privacy-modal-title {
  font-size: 16px;
  font-weight: 800;
  color: #1a1a2e;
}
.privacy-modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  font-size: 22px; color: #8892a8;
  cursor: pointer; border-radius: 50%;
  line-height: 1;
  transition: background 0.14s;
}
.privacy-modal-close:hover { background: #f0f4f8; color: #1a1a2e; }
.privacy-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  font-size: 13.5px;
  color: #4a5568;
  line-height: 1.6;
}
.privacy-modal-body h4 {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 14px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.privacy-modal-body p { margin-bottom: 4px; }
.privacy-modal-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHATBOT — Floating Action Button + Panel
   ═══════════════════════════════════════════════════════════════════════════ */
.chatbot-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 8000;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(26,115,232,0.45), 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.2s, box-shadow 0.2s;
  color: #fff;
}
.chatbot-fab:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 32px rgba(26,115,232,0.55), 0 4px 12px rgba(0,0,0,0.20);
}
.chatbot-fab:active { transform: scale(0.96); }
.chatbot-fab-icon { font-size: 26px; line-height: 1; }
/* Notification badge on FAB */
.chatbot-fab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e94560;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Chat Panel */
.chatbot-panel {
  position: fixed;
  bottom: 98px;
  right: 28px;
  z-index: 8000;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.10);
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  animation: chatPanelIn 0.26s cubic-bezier(0.34,1.56,0.64,1);
  border: 1px solid rgba(0,0,0,0.08);
}
.chatbot-panel.hidden { display: none !important; }
@keyframes chatPanelIn {
  from { transform: scale(0.85) translateY(20px); opacity: 0; transform-origin: bottom right; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; transform-origin: bottom right; }
}

/* Chat Header */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  flex-shrink: 0;
}
.chatbot-header-info { display: flex; align-items: center; gap: 10px; }
.chatbot-avatar {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.22);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.chatbot-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.chatbot-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.70);
  margin-top: 1px;
}
.chatbot-close {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.18);
  border: none; border-radius: 50%;
  font-size: 18px; color: #fff;
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.14s;
}
.chatbot-close:hover { background: rgba(255,255,255,0.30); }

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f7f9fc;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }

/* Chat bubbles */
.chat-bubble {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble.bot {
  background: #fff;
  color: #1a1a2e;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
}
.chat-bubble.user {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.bot strong { color: #1a73e8; }
.chat-bubble.bot ul {
  margin: 6px 0 2px 16px;
  padding: 0;
  font-size: 12.5px;
}
.chat-bubble.bot li { margin-bottom: 3px; }
/* Typing indicator */
.chat-typing {
  display: flex; gap: 4px; align-items: center;
  padding: 10px 13px;
  background: #fff;
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
}
.chat-typing span {
  width: 7px; height: 7px;
  background: #1a73e8;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
  opacity: 0.7;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-6px); }
}
/* Timestamp in bubble */
.chat-ts {
  font-size: 10px;
  color: rgba(255,255,255,0.60);
  margin-top: 4px;
  text-align: right;
}
.chat-bubble.bot .chat-ts { color: #a0aec0; text-align: left; }

/* Quick reply chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background: #eef3fb;
  border: 1.5px solid rgba(26,115,232,0.28);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.1s;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
  text-align: left;
  outline: none;
}
.chat-chip:hover  { background: #dbeafe; border-color: rgba(26,115,232,0.55); transform: translateY(-1px); }
.chat-chip:active { transform: scale(0.96); }

/* Input row */
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.07);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #dde3ea;
  border-radius: 24px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #1a1a2e;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input:focus {
  border-color: #1a73e8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.10);
}
.chat-input::placeholder { color: #a0aec0; font-size: 12.5px; }
.chat-send-btn {
  width: 38px; height: 38px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  border: none; border-radius: 50%;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(26,115,232,0.35);
}
.chat-send-btn:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(26,115,232,0.45); }
.chat-send-btn:active { transform: scale(0.94); }

/* Mobile adjustments */
@media (max-width: 480px) {
  .chatbot-fab  { bottom: 18px; right: 18px; width: 52px; height: 52px; }
  .chatbot-panel { bottom: 82px; right: 14px; width: calc(100vw - 28px); height: 420px; }
}
