:root {
  --primary: #2563eb;
  --primary-dk: #1d4ed8;
  --success: #16a34a;
  --warn: #ca8a04;
  --danger: #dc2626;
  --purple: #7c3aed;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --header: #0f172a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: .6rem; }
h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: .5rem; }
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: .4rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: .3rem; }
p { margin-bottom: .8rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-content { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }

/* ── Header ── */
.site-header {
  background: var(--header);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 20px; height: 60px;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  color: #fff; font-size: 1.1rem; font-weight: 700;
  white-space: nowrap; text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 1.3rem; }
.logo-tagline { font-size: .7rem; font-weight: 400; color: #94a3b8; display: block; line-height: 1; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 6px; margin-left: auto;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: #e2e8f0; border-radius: 2px; transition: .2s;
}
.primary-nav {
  display: flex; gap: 2px; margin-left: auto; align-items: center;
}
.primary-nav a {
  color: #cbd5e1; font-size: .82rem; font-weight: 500;
  padding: 6px 10px; border-radius: 5px;
  text-decoration: none; transition: .15s; white-space: nowrap;
}
.primary-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.primary-nav a.active { background: var(--primary); color: #fff; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff; padding: 40px 20px 36px;
  text-align: center;
}
.hero h1 { font-size: 1.8rem; color: #fff; margin-bottom: .4rem; }
.hero p { color: #94a3b8; margin-bottom: 1.5rem; max-width: 560px; margin-left: auto; margin-right: auto; }
.stat-row { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.stat-box {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius); padding: 14px 28px; min-width: 120px;
}
.stat-num { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: .75rem; color: #94a3b8; margin-top: 2px; }

/* ── Section ── */
.section { margin-bottom: 36px; }
.section-title {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── IPO Cards ── */
.ipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.ipo-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.ipo-card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ipo-avatar {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.card-name { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.card-industry { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: .8rem; margin-bottom: 12px; }
.card-meta-item label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card-meta-item span { font-weight: 600; }
.card-foot { display: flex; align-items: center; justify-content: space-between; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 20px;
}
.badge-open     { background: #dcfce7; color: #15803d; }
.badge-upcoming { background: #dbeafe; color: #1d4ed8; }
.badge-closed   { background: #f1f5f9; color: #64748b; }
.badge-listed   { background: #ede9fe; color: #6d28d9; }
.badge-subscribe { background: #dcfce7; color: #15803d; }
.badge-neutral   { background: #fef9c3; color: #854d0e; }
.badge-avoid     { background: #fee2e2; color: #b91c1c; }
.gain  { color: var(--success); font-weight: 700; }
.loss  { color: var(--danger);  font-weight: 700; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.ipo-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .83rem; }
.ipo-table th {
  background: var(--primary); color: #fff;
  padding: 11px 14px; text-align: left; font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}
.ipo-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ipo-table tbody tr:last-child td { border-bottom: none; }
.ipo-table tbody tr:hover { background: #f8fafc; }
.ipo-table tbody tr:nth-child(even) { background: #fafbfc; }
.ipo-table tbody tr:nth-child(even):hover { background: #f0f4f8; }
.company-cell { display: flex; align-items: center; gap: 10px; }
.mini-avatar {
  width: 32px; height: 32px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: #fff; flex-shrink: 0;
}

/* ── Filter Bar ── */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar button {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: .8rem;
  font-weight: 600; cursor: pointer; transition: .15s;
}
.filter-bar button:hover { border-color: var(--primary); color: var(--primary); }
.filter-bar button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination button {
  padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .82rem; cursor: pointer;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:hover:not(.active) { border-color: var(--primary); }

/* ── Compact Broker Strip ── */
.broker-strip-section {
  background: #f8faff;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 20px 24px;
}
.broker-strip-inner { max-width: 1200px; margin: 0 auto; }
.broker-strip-label {
  font-size: .65rem; font-weight: 800; letter-spacing: .12em;
  color: var(--muted); text-align: center; margin-bottom: 14px;
}
.broker-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.broker-chip {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0;
  border-top: 3px solid var(--bc, var(--primary));
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
.broker-chip:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  transform: translateY(-2px);
  text-decoration: none;
}
.broker-chip-icon {
  width: 40px; height: 40px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 900; color: #fff;
  flex-shrink: 0; letter-spacing: -.02em;
}
.broker-chip-body { flex: 1; min-width: 0; }
.broker-chip-name { font-weight: 800; font-size: .92rem; line-height: 1.2; }
.broker-chip-desc { font-size: .71rem; color: var(--muted); margin-top: 2px; }
.broker-chip-btn {
  display: inline-block; padding: 7px 13px; border-radius: 7px;
  color: #fff; font-size: .72rem; font-weight: 800;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  letter-spacing: .01em;
  transition: opacity .15s, transform .15s;
}
.broker-chip:hover .broker-chip-btn { opacity: .88; transform: scale(1.03); }

/* ── Hero Broker Banner ── */
.broker-hero-section {
  background: linear-gradient(160deg, #06091a 0%, #0d1b3e 45%, #0f0d2a 100%);
  padding: 56px 20px 48px;
  position: relative; overflow: hidden;
}
.broker-hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 50%, rgba(56,126,209,.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 85% 30%, rgba(192,57,43,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 50% 90%, rgba(92,107,192,.13) 0%, transparent 70%);
  pointer-events: none;
}
.broker-hero-inner {
  max-width: 1100px; margin: 0 auto; position: relative;
}
.broker-hero-head { text-align: center; margin-bottom: 36px; }
.broker-hero-eyebrow {
  font-size: .6rem; font-weight: 800; letter-spacing: .18em;
  color: #475569; margin-bottom: 10px;
}
.broker-hero-title {
  font-size: 1.9rem; font-weight: 800; color: #fff;
  margin-bottom: 10px; letter-spacing: -.02em; line-height: 1.2;
}
.broker-hero-subtitle {
  color: #94a3b8; font-size: .9rem;
  max-width: 500px; margin: 0 auto; line-height: 1.65;
}
.broker-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* Individual hero cards */
.broker-hero-card {
  border-radius: 16px; padding: 30px 24px 28px;
  text-align: center; position: relative; overflow: hidden;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s;
  cursor: default;
}
.broker-hero-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,.45);
}
.bh-glow {
  position: absolute; inset: 0; opacity: 0; z-index: 0;
  transition: opacity .22s;
  border-radius: 16px;
  pointer-events: none;
}
.broker-hero-card:hover .bh-glow { opacity: 1; }

/* Zerodha */
.bh-zerodha {
  background: linear-gradient(145deg, #1a3d6e 0%, #2a5fa8 60%, #1e4d8c 100%);
  border: 1px solid rgba(56,126,209,.4);
  box-shadow: 0 8px 32px rgba(56,126,209,.25);
}
.bh-zerodha .bh-glow {
  background: radial-gradient(ellipse at 50% 0%, rgba(100,170,255,.18) 0%, transparent 70%);
}

/* Fyers */
.bh-fyers {
  background: linear-gradient(145deg, #6b1515 0%, #b03030 60%, #8b1e1e 100%);
  border: 1px solid rgba(192,57,43,.4);
  box-shadow: 0 8px 32px rgba(192,57,43,.25);
}
.bh-fyers .bh-glow {
  background: radial-gradient(ellipse at 50% 0%, rgba(255,120,100,.18) 0%, transparent 70%);
}

/* Upstox */
.bh-upstox {
  background: linear-gradient(145deg, #1e1560 0%, #4040a0 60%, #2a1e80 100%);
  border: 1px solid rgba(92,107,192,.4);
  box-shadow: 0 8px 32px rgba(92,107,192,.25);
}
.bh-upstox .bh-glow {
  background: radial-gradient(ellipse at 50% 0%, rgba(140,140,255,.18) 0%, transparent 70%);
}

.bh-badge {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.18); color: rgba(255,255,255,.9);
  font-size: .6rem; font-weight: 800; padding: 3px 9px;
  border-radius: 20px; border: 1px solid rgba(255,255,255,.25);
  letter-spacing: .07em; text-transform: uppercase;
}
.bh-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255,255,255,.18);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; color: #fff;
  border: 2px solid rgba(255,255,255,.25);
  letter-spacing: -.04em;
}
.bh-name {
  font-size: 1.5rem; font-weight: 800; color: #fff;
  margin-bottom: 4px; letter-spacing: -.02em;
}
.bh-tag {
  font-size: .75rem; color: rgba(255,255,255,.65);
  margin-bottom: 18px; font-weight: 500;
}
.bh-features {
  list-style: none; padding: 0; margin: 0 0 22px;
  font-size: .8rem; color: rgba(255,255,255,.85);
  line-height: 1.85; text-align: left;
}
.bh-features li { display: flex; align-items: flex-start; gap: 7px; }
.bh-features li::before {
  content: '✓'; color: rgba(255,255,255,.9);
  font-weight: 800; flex-shrink: 0; margin-top: 1px;
}
.bh-cta {
  display: inline-block;
  padding: 12px 28px; border-radius: 10px;
  background: rgba(255,255,255,.96);
  font-size: .85rem; font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: background .15s, box-shadow .15s, transform .15s;
  letter-spacing: .01em;
}
.bh-cta:hover {
  background: #fff; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transform: scale(1.03);
}
.broker-hero-disclaimer {
  text-align: center; font-size: .68rem; color: #334155;
  margin: 0;
}

/* Broker Cards (legacy fallback, kept for any remaining pages) */
.broker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.broker-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  border: 1px solid var(--border); text-align: center;
}
.broker-name { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.broker-card p { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.btn {
  display: inline-block; padding: 8px 20px; border-radius: var(--radius);
  font-size: .82rem; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; border: none; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; text-decoration: none; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: none; }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ── Info Box ── */
.info-box {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  border-left: 4px solid var(--primary);
}
.info-box h2 { margin-bottom: 10px; }
.info-box ul { line-height: 1.8; }
.warn-box {
  background: #fffbeb; border-radius: var(--radius);
  border: 1px solid #fde68a; padding: 14px 18px; margin-top: 16px;
  font-size: .83rem; color: #92400e;
}

/* ── Error State ── */
.error-state {
  text-align: center; padding: 48px 20px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.error-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.error-state h3 { color: var(--text); margin-bottom: 8px; }
.error-state p { color: var(--muted); font-size: .85rem; }

/* ── Static Page ── */
.static-page { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 28px; }
.static-page h1 { border-bottom: 2px solid var(--border); padding-bottom: 12px; margin-bottom: 20px; }
.static-page ol, .static-page ul { margin-bottom: 1rem; }
.static-page li { margin-bottom: .6rem; }

/* ── Steps ── */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step; padding: 14px 14px 14px 56px;
  position: relative; background: var(--surface);
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .8rem;
}

/* ── Two-column ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ── Loading ── */
.loading-row td { text-align: center; padding: 32px; color: var(--muted); font-style: italic; }

/* ── Footer ── */
.site-footer { background: var(--header); color: #94a3b8; padding: 32px 20px 20px; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-tagline { margin-bottom: 16px; font-size: .85rem; color: #64748b; }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.footer-nav a { color: #94a3b8; font-size: .82rem; text-decoration: none; }
.footer-nav a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e3a5f; padding-top: 16px; font-size: .78rem; color: #475569; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; background: #1e293b;
    padding: 12px 0; gap: 0;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 12px 24px; border-radius: 0; font-size: .9rem; }
  .header-inner { position: relative; }
  .two-col { grid-template-columns: 1fr; }
  .broker-hero-grid { grid-template-columns: 1fr; gap: 14px; }
  .broker-hero-title { font-size: 1.5rem; }
  .broker-strip { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 680px) {
  .hero h1 { font-size: 1.4rem; }
  .stat-num { font-size: 1.5rem; }
  .stat-box { padding: 12px 18px; }
  .ipo-table thead { display: none; }
  .ipo-table tr { display: block; background: var(--surface); margin-bottom: 10px; border-radius: var(--radius); border: 1px solid var(--border); padding: 12px; box-shadow: var(--shadow); }
  .ipo-table td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 5px 0; font-size: .8rem; }
  .ipo-table td::before { content: attr(data-label); font-weight: 600; color: var(--muted); flex-shrink: 0; margin-right: 8px; min-width: 110px; }
  .ipo-table tbody tr:nth-child(even) { background: var(--surface); }
  .broker-hero-section { padding: 40px 16px 36px; }
  .broker-hero-card { padding: 24px 20px; }
  .bh-icon { width: 52px; height: 52px; font-size: 1.4rem; }
  .bh-name { font-size: 1.25rem; }
  .broker-chip-btn { display: none; }
  .broker-chip { gap: 10px; }
}
