:root {
  --navy: #123059;
  --navy-2: #1b4079;
  --blue: #2f6fed;
  --blue-light: #f0f4ff;
  --bg: #ffffff;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --teal: #14b8a6;
  --gold: #d8b45a;
  --silver: #94a3b8;
  --orange: #f97316;
  --orange-bg: #fff7ed;
  --gemini-grad: linear-gradient(135deg, #1e3a8a, #3b82f6, #06b6d4);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #ffffff;
    --card: #ffffff;
    --line: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --blue-light: #f0f4ff;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #ffffff; }
body {
  background: #ffffff;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; }

.phone {
  max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 35px rgba(0,0,0,0.06);
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

/* ============================================================
   DYNAMIC FLASH SPLASH SCREEN
   ============================================================ */
#flashSplashScreen {
  position: fixed;
  inset: 0;
  max-width: 480px;
  margin: 0 auto;
  z-index: 999;
  background: linear-gradient(145deg, #091629 0%, #123059 55%, #1b4079 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #ffffff;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#flashSplashScreen.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo-glow {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05));
  border: 1.5px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  box-shadow: 0 0 45px rgba(47, 111, 237, 0.45);
  animation: splashPulse 2.4s infinite ease-in-out;
  margin-bottom: 22px;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(47, 111, 237, 0.35); }
  50% { transform: scale(1.05); box-shadow: 0 0 55px rgba(59, 130, 246, 0.65); }
}
.splash-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 40%, #bfdbfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.splash-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
  margin-bottom: 36px;
}
.splash-loader-bar {
  width: 180px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}
.splash-loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.splash-status {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
}
.splash-skip-btn {
  position: absolute;
  bottom: 28px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 14px;
  cursor: pointer;
}

/* Header */
.navhead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.navhead h1 { font-size: 16.5px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -0.01em; }
.navhead .subline { font-size: 11.5px; color: rgba(255,255,255,0.8); margin-top: 2px; font-weight: 400; display: flex; align-items: center; gap: 6px; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.live-badge i { width: 5px; height: 5px; border-radius: 50%; background: #34d399; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.iconbtn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.iconbtn:active { background: rgba(255,255,255,0.25); }

.content { padding: 16px 16px 36px; background: #ffffff; }

h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 20px 0 10px;
  font-weight: 700;
}
h3:first-child { margin-top: 4px; }
.intro-p { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0 0 12px; }

/* Screens */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.2s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* Bottom Sheets & Modals */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}
.sheet.open { display: flex; }
.sheet-inner {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  position: relative;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.12);
}
.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Chips & Search */
.chiprow-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.chiprow-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chip.on {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.searchbox {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 13.5px;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.searchbox:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

/* Fund Cards - Uniform Spacing */
.fcard {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 15px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
}
.fcard:hover { border-color: var(--blue); }
.fcard:active { transform: scale(0.99); background: var(--blue-light); }
.fcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fcard-name { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--text); }
.fcard-name .star { color: var(--amber); margin-left: 4px; }
.fcard-nav { font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.fcard-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fcard-mix { font-size: 11px; color: var(--muted); margin-top: 7px; }
.fcard-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.pill-return { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 12px; font-family: 'IBM Plex Mono', monospace; }
.pill-return.pos { background: var(--green-bg); color: var(--green); }
.pill-return.neg { background: var(--red-bg); color: var(--red); }
.pill-return.flat { background: #f1f5f9; color: var(--muted); }
.fcard-amc { font-size: 11px; color: var(--muted); }
.rowcount { font-size: 11.5px; color: var(--muted); margin-top: 6px; text-align: center; }

/* Verified Full Cycle Badge */
.cycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 4px;
}

/* Period Tabs */
.periodtabs { display: flex; gap: 6px; margin-bottom: 12px; }
.periodtabs button {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.periodtabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Donut & Legends */
.donut-row { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.dl-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dl-item i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.dl-item b { margin-left: auto; font-family: 'IBM Plex Mono', monospace; }

/* General Cards & Inputs */
.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.card.highlight {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  border: none;
}
.card label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.card.highlight label { color: rgba(255,255,255,0.75); }
.bignum {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14.5px;
  font-weight: 600;
}
.bignum:focus { outline: none; border-color: var(--blue); }

.segmented2 {
  display: flex;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
}
.segmented2 button {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.segmented2 button.on { background: var(--navy); color: #fff; }

.goal-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}
.warn-box {
  background: var(--blue-light);
  border: 1px solid rgba(47, 111, 237, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 11.5px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 14px;
}
.warn-box strong { color: var(--navy); }

.alert-card {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 10px;
  border-left: 4px solid;
}
.alert-card.warning { background: var(--orange-bg); border-color: var(--orange); color: #9a3412; }
.alert-card.info { background: var(--blue-light); border-color: var(--blue); color: #1e40af; }
.alert-card.success { background: var(--green-bg); border-color: var(--green); color: #065f46; }
.alert-card b { display: block; font-size: 12.5px; margin-bottom: 3px; }

/* 1 Crore Goal Planner Styles */
.crore-hero {
  background: linear-gradient(135deg, #0e2746, #1e3a8a);
  color: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.crore-badge {
  display: inline-block;
  background: rgba(216, 180, 90, 0.25);
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.4);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.crore-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
}
.crore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.crore-metric {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
}
.crore-metric .lbl { font-size: 10px; color: rgba(255, 255, 255, 0.7); text-transform: uppercase; font-weight: 700; }
.crore-metric .val { font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 800; margin-top: 2px; }

/* Milestone Forecast Cards */
.milestone-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.milestone-card {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.milestone-card:hover { border-color: var(--blue); }
.milestone-card.active { border-color: var(--navy); background: var(--blue-light); }
.milestone-card .m-target { font-family: 'IBM Plex Mono', monospace; font-size: 15px; font-weight: 800; color: var(--navy); }
.milestone-card .m-time { font-size: 12px; font-weight: 700; color: var(--green); margin-top: 3px; }
.milestone-card .m-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }

.strategy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.strategy-row:hover { border-color: var(--blue); }
.strategy-row.featured { border-color: var(--navy); background: var(--blue-light); box-shadow: 0 2px 8px rgba(18, 48, 89, 0.08); }
.strategy-row .st-name { font-size: 13px; font-weight: 700; color: var(--text); }
.strategy-row .st-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.strategy-row .st-amt { font-family: 'IBM Plex Mono', monospace; font-size: 14.5px; font-weight: 800; color: var(--navy); text-align: right; }
.strategy-row.featured .st-amt { color: var(--navy); }

/* Progression Table */
.progtbl-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
}
.progtbl { width: 100%; border-collapse: collapse; font-size: 11.5px; text-align: left; }
.progtbl th { background: #f8fafc; color: var(--muted); padding: 9px 10px; font-weight: 700; text-transform: uppercase; font-size: 9.5px; }
.progtbl td { padding: 9px 10px; border-top: 1px solid var(--line); font-family: 'IBM Plex Mono', monospace; }
.progtbl tr:hover td { background: #f8fafc; }

/* Fund Allocation Item */
.sip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.sip-item .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sip-item .si-info { flex: 1; }
.sip-item .si-name { font-size: 13px; font-weight: 700; color: var(--text); }
.sip-item .si-cat { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.sip-item .si-amt { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 700; text-align: right; }
.sip-item .si-pct { font-size: 10.5px; color: var(--muted); text-align: right; }

.btn-swap {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid rgba(47, 111, 237, 0.2);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 12px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
}
.btn-navy { background: var(--navy); color: #fff; }
.btn-outline { background: #ffffff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-excel { background: #047857; color: #fff; }
.btn:active { opacity: 0.85; }

/* ============================================================
   ROLLING RETURNS — WORST (RED) & BEST (GREEN) DIFFERENT COLORS
   ============================================================ */
.rangechart-row {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rangechart-row:hover { background: #f8fafc; border-color: var(--blue); }
.rangechart-row:last-child { border-bottom: none; }
.rc-label { font-size: 13px; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.rc-sub { font-size: 11px; color: var(--muted); margin-bottom: 8px; }

/* Track Bar with Gradient from Red to Green */
.rc-track {
  position: relative;
  height: 7px;
  background: #f1f5f9;
  border-radius: 6px;
  margin: 6px 0 6px;
}
.rc-range {
  position: absolute;
  top: 0;
  height: 7px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.45) 0%, rgba(47, 111, 237, 0.4) 50%, rgba(16, 185, 129, 0.55) 100%);
}
.rc-avg {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--navy);
  box-shadow: 0 0 4px rgba(18, 48, 89, 0.5);
}
.rc-vals {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
}
/* Distinct Worst and Best Colors */
.rc-vals .rc-worst {
  color: var(--red);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 3px;
}
.rc-vals .rc-avg-val {
  color: var(--navy);
  font-weight: 800;
}
.rc-vals .rc-best {
  color: var(--green);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 3px;
}
.rc-note { font-size: 10.5px; color: var(--amber); margin-top: 5px; line-height: 1.5; }

/* Scenario 3 Card Grid */
.scenario3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 8px; }
.scard { background: #ffffff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 8px; text-align: center; }
.scard.mid { border-color: var(--navy); background: var(--blue-light); }
.scard .sl { font-size: 9.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.scard .sv { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 700; margin-top: 4px; }
.scard .sb { height: 4px; border-radius: 3px; margin-top: 8px; }

/* Bottom Nav */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.navbtn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 1px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.navbtn .ic { font-size: 15px; }
.navbtn.on { color: var(--navy); font-weight: 700; }
@media (min-width: 380px) {
  .navbtn { font-size: 9px; padding: 9px 2px 7px; }
  .navbtn .ic { font-size: 16px; }
}

/* ============================================================
   INVEST EXPLORER ASSISTANT (CHATBOT WIDGET)
   ============================================================ */
.gemini-float-btn {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px) + 12px);
  right: 16px;
  z-index: 50;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(18, 48, 89, 0.4);
  border: 2.5px solid #ffffff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.gemini-float-btn:active { transform: scale(0.92); }

.chat-bubble-user {
  background: var(--navy);
  color: #fff;
  border-radius: 14px 14px 2px 14px;
  padding: 10px 13px;
  font-size: 12.5px;
  max-width: 85%;
  margin-left: auto;
  margin-bottom: 8px;
  line-height: 1.45;
}
.chat-bubble-bot {
  background: #f1f5f9;
  color: var(--text);
  border-radius: 14px 14px 14px 2px;
  padding: 11px 14px;
  font-size: 12.5px;
  max-width: 90%;
  margin-right: auto;
  margin-bottom: 8px;
  line-height: 1.55;
  border: 1px solid var(--line);
}
.chat-bubble-bot b { color: var(--navy); }
.chat-prompt-chip {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
}

/* ============================================================
   PROGRESSION & DATA TABLES
   ============================================================ */
.progtbl-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.progtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  min-width: 320px;
}

.progtbl thead tr {
  background: #f8fafc;
  border-bottom: 2px solid var(--line);
}

.progtbl th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
  white-space: nowrap;
}

.progtbl td {
  padding: 9px 12px;
  font-size: 11.5px;
  color: var(--text);
  border-bottom: 1px solid #f1f5f9;
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
}

.progtbl tbody tr:last-child td {
  border-bottom: none;
}

.progtbl tbody tr:nth-child(even) {
  background: #fafcff;
}

.progtbl tbody tr:hover {
  background: var(--blue-light);
}

.progtbl td:last-child {
  color: var(--navy);
  font-weight: 700;
}

/* Chat typing indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 12px 12px 12px 2px;
  width: fit-content;
  margin-bottom: 8px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.chat-typing span:nth-child(1) { animation-delay: 0s; }
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* ============================================================
   RESPONSIVE DESKTOP & TABLET WEBSITE LAYOUT
   ============================================================ */
@media (min-width: 768px) {
  body {
    background: #f1f5f9;
  }

  .phone {
    max-width: 960px;
    margin: 24px auto;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    padding-bottom: 84px;
    border: 1px solid #e2e8f0;
  }

  #flashSplashScreen {
    max-width: 960px;
    border-radius: 20px;
  }

  .navhead {
    padding: 18px 28px;
    border-radius: 20px 20px 0 0;
  }

  .content {
    padding: 24px 32px 48px;
  }

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

  .milestone-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .bottomnav {
    max-width: 960px;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 auto;
    border-radius: 0 0 20px 20px;
    border: 1px solid #e2e8f0;
    justify-content: center;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  }

  .bottomnav .navbtn {
    padding: 10px 14px 8px;
    font-size: 11px;
    max-width: 125px;
    gap: 4px;
    transition: all 0.2s ease;
  }

  .bottomnav .navbtn:hover {
    color: var(--blue);
    background: #f8fafc;
  }

  .desktop-top-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 10px auto 0;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 8px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 720px;
  }

  .d-nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.88);
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .d-nav-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
  }

  .d-nav-btn.on {
    color: var(--navy);
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .sheet-inner {
    max-width: 620px;
    border-radius: 20px;
    margin: auto;
  }

  .sheet {
    align-items: center;
  }
}

/* ============================================================
   AUM BADGES, LIVE SEARCH PROMPT & AI RATIONALE STYLES
   ============================================================ */
.desktop-top-nav {
  display: none;
}

.badge-aum {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
}

.badge-ter {
  display: inline-flex;
  align-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

.live-search-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px dashed var(--blue);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
}

.live-search-prompt:hover {
  background: var(--blue-light);
  border-color: var(--navy);
}

.ai-rationale-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.ai-rationale-card:hover {
  border-color: var(--blue);
  border-left-color: var(--blue);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);
}

.ai-rationale-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
}

.ai-rationale-fund {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
}

.ai-rationale-role {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.ai-rationale-thesis {
  font-size: 11.5px;
  color: #334155;
  line-height: 1.55;
  margin: 0 0 6px;
}

.ai-rationale-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============================================================
   SCREENER.IN STYLE INSTITUTIONAL FUND ANALYSIS STYLES
   ============================================================ */
.screener-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 14px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 14px;
}

.btn-screener-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-screener-back:hover {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.screener-scheme-header {
  margin-bottom: 16px;
}

.screener-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 6px;
}

.screener-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.sc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.sc-badge-navy {
  background: #eef2ff;
  color: #1e3a8a;
  border-color: #c7d2fe;
}

.sc-badge-cat {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.sc-badge-rating {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
  font-weight: 700;
}

.screener-price-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sc-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.sc-nav-val {
  font-size: 26px;
  font-weight: 800;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--navy);
  line-height: 1;
}

.sc-nav-date {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.sc-return-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
}

.sc-return-pos {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.sc-return-neg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* 52-Week Range Bar */
.sc-52w-container {
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}

.sc-52w-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.sc-52w-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  position: relative;
  margin: 6px 0;
}

.sc-52w-progress {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 3px;
}

.sc-52w-pin {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  background: var(--navy);
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transform: translateX(-50%);
}

/* Screener Section Title */
.sc-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 6px;
  margin: 22px 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Iconic Screener Ratios Grid */
.screener-ratios-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.sc-ratio-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.sc-ratio-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sc-ratio-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sc-ratio-val {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  font-family: 'IBM Plex Mono', monospace;
  margin: 3px 0 2px;
}

.sc-ratio-sub {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Screener Multi-Timeframe Chart Card */
.sc-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.sc-chart-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sc-tf-row {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.sc-tf-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sc-tf-btn:hover {
  color: var(--navy);
}

.sc-tf-btn.active {
  background: var(--navy);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sc-chart-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.sc-stat-pill {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sc-chart-canvas {
  width: 100%;
  min-height: 200px;
}

.sc-chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  font-size: 11px;
  color: #475569;
}

.sc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Screener Signature PROS & CONS */
.screener-pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.sc-pros-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 16px;
}

.sc-pros-title {
  font-size: 12px;
  font-weight: 800;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-pro-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #14532d;
  margin-bottom: 8px;
}

.sc-pro-item:last-child {
  margin-bottom: 0;
}

.sc-pro-icon {
  color: #16a34a;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1.4;
}

.sc-cons-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 14px 16px;
}

.sc-cons-title {
  font-size: 12px;
  font-weight: 800;
  color: #991b1b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-con-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: #7f1d1d;
  margin-bottom: 8px;
}

.sc-con-item:last-child {
  margin-bottom: 0;
}

.sc-con-icon {
  color: #dc2626;
  font-weight: 900;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* Screener Tables */
.screener-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 18px;
  background: #ffffff;
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  white-space: nowrap;
}

.screener-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px 10px;
  text-align: right;
  border-bottom: 1px solid #e2e8f0;
}

.screener-table th.th-left,
.screener-table td.td-left {
  text-align: left;
}

.screener-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: #1e293b;
}

.screener-table tr:hover td {
  background: #f8fafc;
}

.screener-table tr.current-fund td {
  background: #eff6ff;
  font-weight: 700;
}

.screener-table tr.current-fund:hover td {
  background: #dbeafe;
}

.badge-current {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 5px;
  vertical-align: middle;
  font-family: 'Inter', sans-serif;
}

.sc-peer-link {
  color: #1e40af;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.sc-peer-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

/* Market Cap Distribution Bar */
.sc-mcap-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.sc-mcap-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin: 10px 0 10px;
  background: #e2e8f0;
}

.sc-mcap-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.sc-mcap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11px;
  color: #334155;
}

.sc-mcap-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sc-mcap-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* Sector Breakdown */
.sc-sector-item {
  margin-bottom: 10px;
}

.sc-sector-head {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #334155;
  margin-bottom: 3px;
}

.sc-sector-track {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.sc-sector-fill {
  height: 100%;
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  border-radius: 3px;
}

/* Screener Interactive SIP Compounding Calculator */
.sc-sip-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.sc-sip-controls {
  margin-bottom: 16px;
}

.sc-sip-slider-val {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sc-sip-quick-chips {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.sc-sip-chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.sc-sip-chip:hover {
  background: var(--blue-light);
  border-color: var(--blue);
}

.sc-sip-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.sc-sip-res-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.sc-sip-res-card.highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.sc-sip-res-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.sc-sip-res-val {
  font-size: 15px;
  font-weight: 800;
  font-family: 'IBM Plex Mono', monospace;
  margin-top: 3px;
  color: var(--navy);
}

.sc-sip-res-val.text-green {
  color: #059669;
}

.sc-sip-res-sub {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

/* Screener Bottom Action Bar */
.screener-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 20px;
}

/* Desktop Screener Media Queries (min-width: 768px) */
@media (min-width: 768px) {
  .screener-ratios-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .screener-pros-cons-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .sc-sip-results-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .screener-action-bar {
    grid-template-columns: repeat(4, 1fr);
  }

  .screener-title {
    font-size: 22px;
  }

  .sc-nav-val {
    font-size: 30px;
  }
}
