/* Container & Compact Fonts */
.pipo-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #111; max-width: 900px; margin: 0 auto; background: transparent; padding: 0; }
.pipo-box { background: #fff; border: 1px solid #e5e7eb; border-radius: 6px; padding: 15px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.pipo-compact-box { padding: 12px 15px; } 
.pipo-heading { font-size: 16px; color: #1e40af; border-bottom: 1px solid #e5e7eb; padding-bottom: 8px; margin: 0 0 10px 0; display: flex; align-items: center; gap: 6px; }

/* Ad Slots */
.pipo-ad-slot { margin-bottom: 12px; text-align: center; overflow: hidden; }

/* Header & Status */
.pipo-head-grid { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.pipo-title-wrap { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 250px; }
.pipo-logo { width: 65px !important; height: 65px !important; min-width: 65px !important; max-width: 65px !important; object-fit: contain !important; border-radius: 4px; border: 1px solid #e5e7eb; padding: 2px; background:#fff; flex-shrink: 0; }
.pipo-head-text { display: flex; flex-direction: column; justify-content: center; }
.pipo-h2 { margin: 0 0 4px 0 !important; font-size: 18px !important; font-weight: 700 !important; line-height: 1.2; }
.pipo-tag { font-size: 10px; background: #059669; color: #fff; padding: 2px 5px; border-radius: 3px; vertical-align: middle; margin-left: 4px; }
.pipo-status { display: inline-flex; align-items: center; font-size: 11px; padding: 3px 8px; border-radius: 12px; font-weight: bold; width: max-content; }
.pipo-status.live { background: #fee2e2; color: #b91c1c; }
.pipo-status.upcoming { background: #fef3c7; color: #b45309; }
.pipo-status.allotment-awaited { background: #e0e7ff; color: #4338ca; }
.pipo-status.allotment-out, .pipo-status.listed { background: #dcfce7; color: #15803d; }
.pipo-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 4px; }

/* Action Wrap & Buttons */
.pipo-action-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pipo-price-box { text-align: right; color: #059669; }
.pipo-price-box strong { font-size: 20px; }
.pipo-shares { font-size: 12px; color: #6b7280; }
.pipo-btn-box { text-align: right; }

.pipo-apply-btn { display: inline-flex; align-items: center; background: #dc2626 !important; color: #ffffff !important; padding: 6px 18px; border-radius: 25px; font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3); }
.pipo-apply-btn:hover { background: #2563eb !important; color: #ffffff !important; transform: scale(1.08); box-shadow: 0 6px 15px rgba(37, 99, 235, 0.5); }
.pipo-pulse { display: inline-block; width: 8px; height: 8px; background: #fff; border-radius: 50%; margin-right: 6px; animation: pipoPulse 1.5s infinite; }
@keyframes pipoPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); } 70% { box-shadow: 0 0 0 6px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

.pipo-allot-btn { display: inline-flex; background: #059669 !important; color: #ffffff !important; padding: 6px 15px; border-radius: 4px; font-size: 12px; font-weight: bold; text-decoration: none; box-shadow: 0 2px 4px rgba(5, 150, 105, 0.3); transition: 0.2s; }
.pipo-allot-btn:hover { background: #047857 !important; transform: translateY(-2px); }

/* Modal Popup */
.pipo-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9999; display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.pipo-modal-content { background: #fff; border-radius: 12px; width: 90%; max-width: 400px; padding: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); animation: popIn 0.3s ease-out; }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pipo-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e5e7eb; padding-bottom: 10px; margin-bottom: 15px; }
.pipo-modal-header h3 { margin: 0; font-size: 18px; color: #1e293b; }
.pipo-modal-close { font-size: 24px; color: #94a3b8; cursor: pointer; font-weight: bold; line-height: 1; }
.pipo-modal-close:hover { color: #ef4444; }
.pipo-broker-list { display: flex; flex-direction: column; gap: 10px; }
.pipo-broker-item { display: flex; align-items: center; text-decoration: none; padding: 10px 15px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; color: #334155; font-weight: bold; font-size: 15px; transition: 0.2s; }
.pipo-broker-item:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; transform: translateX(5px); }
.pipo-b-icon { width: 30px; height: 30px; border-radius: 6px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; margin-right: 12px; }

/* Linear Progress Bar */
.pipo-progress-wrap { position: relative; margin-top: 5px; padding-top: 15px; }
.pipo-progress-bar { position: absolute; top: 23px; left: 10%; right: 10%; height: 4px; background: #e5e7eb; z-index: 1; border-radius: 2px; }
.pipo-progress-fill { position: relative; height: 100%; background: #2563eb; transition: width 0.5s; border-radius: 2px; }
.pipo-progress-fill::after { content: "🐂"; position: absolute; right: -14px; top: -9px; font-size: 18px; line-height: 1; z-index: 5; display: inline-block; transform: scaleX(-1); }
.pipo-steps { display: flex; justify-content: space-between; position: relative; z-index: 2; }
.pipo-step { text-align: center; flex: 1; font-size: 12px; color: #9ca3af; }
.pipo-step::before { content: ""; display: block; width: 10px; height: 10px; background: #e5e7eb; border-radius: 50%; margin: 0 auto 6px; border: 2px solid #fff; transition: 0.3s; }
.pipo-step.active { color: #111827; }
.pipo-step.active::before { background: #2563eb; }
.pipo-step strong { display: block; margin-top: 2px; font-size: 11px; }

/* BIG Expected Premium */
.pipo-gmp-hero { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); color: #fff; text-align: center; padding: 15px; border: none; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); margin-bottom: 12px; }
.pipo-gmp-text { font-size: 14px; opacity: 0.9; margin-bottom: 2px; text-transform: uppercase; font-weight: 600; }
.pipo-gmp-val { font-size: 28px; font-weight: 800; color: #4ade80; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* Read More */
.pipo-collapsed { max-height: 150px; overflow: hidden; position: relative; }
.pipo-collapsed::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 50px; background: linear-gradient(transparent, #ffffff); }
.pipo-read-more { background: #f8fafc; border: 1px solid #cbd5e1; color: #334155; padding: 3px 14px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; transition: 0.3s; }
.pipo-read-more:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Editor & Tables */
.pipo-editor-content table, .pipo-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; }
.pipo-editor-content th, .pipo-table th { background: #f8fafc; padding: 8px; text-align: left; font-weight: 600; color: #1e293b; border: 1px solid #e5e7eb; }
.pipo-editor-content td, .pipo-table td { padding: 8px; border: 1px solid #e5e7eb; color: #334155; }
.pipo-editor-content p { margin: 0 0 10px 0; font-size: 13px; line-height: 1.5; }

/* GMP Tracker */
.pipo-table-resp { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pipo-gmp-table th { background: #e0f2fe; color: #0369a1; text-align: center; font-size: 12px; padding: 6px; }
.pipo-gmp-table td { text-align: center; font-size: 13px; padding: 6px; white-space: nowrap; }
.pipo-up { color: #16a34a; font-size: 11px; }
.pipo-down { color: #dc2626; font-size: 11px; }
.pipo-flat { color: #9ca3af; }

/* Docs & FAQs */
.pipo-doc-btn { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 6px 12px; border-radius: 4px; text-decoration: none; color: #0f172a; font-weight: 600; font-size: 12px; transition: 0.2s; }
.pipo-doc-btn:hover { background: #e2e8f0; color: #1d4ed8; }
.pipo-faq { border-bottom: 1px solid #e5e7eb; }
.pipo-faq summary { padding: 10px 15px; font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; list-style: none; outline: none; }
.pipo-q-icon { color: #dc2626; font-weight: 800; margin-right: 8px; }
.pipo-a-content { padding: 0 15px 15px 35px; font-size: 13px; color: #475569; }

/* Mobile (Single IPO block) */
@media(max-width: 500px) {
    .pipo-head-grid { flex-direction: column; align-items: stretch; }
    .pipo-action-wrap { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px; width: 100%; border-top: 1px solid #e5e7eb; padding-top: 10px; }
    .pipo-price-box { text-align: left; }
    .pipo-price-box strong { font-size: 16px; }
    .pipo-shares { display: inline-block; margin-left: 2px; font-size: 11px; }
    .pipo-apply-btn, .pipo-allot-btn { margin-top: 0; padding: 6px 14px; font-size: 12px; }
    .pipo-progress-bar { left: 12%; right: 12%; }
    .pipo-step span { font-size: 10px; }
    .pipo-step strong { font-size: 9px; }
    .pipo-h2 { font-size: 16px !important; }
    .pipo-box { padding: 12px; margin-bottom: 10px; }
    .pipo-compact-box { padding: 10px; }
}

/* =========================================================
   HOMEPAGE DYNAMIC TABLE STYLING
   ========================================================= */
.ht-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.ht-table { width: 100%; border-collapse: collapse; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 13px; text-align: left; white-space: nowrap; }

/* Dark Header */
.ht-table thead th { background-color: #4b5563; color: #ffffff; padding: 12px 15px; font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; border-bottom: 2px solid #374151; }

/* Rows */
.ht-table tbody td { padding: 12px 15px; border-bottom: 1px solid #f3f4f6; color: #374151; vertical-align: middle; }
.ht-table tbody tr:nth-child(even) { background-color: #f9fafb; }
.ht-table tbody tr:hover { background-color: #f3f4f6; }

/* Links */
.ht-link { color: #2563eb; font-weight: 600; text-decoration: none; }
.ht-link:hover { text-decoration: underline; color: #1d4ed8; }

/* Status Badges */
.ht-stat { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-block; }
.ht-up { background-color: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; } /* Upcoming - Purple */
.ht-act { background-color: #dcfce7; color: #166534; border: 1px solid #86efac; } /* Active - Green */
.ht-clo { background-color: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; } /* Closed - Gray */

/* Type Badges */
.ht-type { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; display: inline-block; }
.ht-sme { background-color: #ffedd5; color: #c2410c; } /* SME - Orange */
.ht-main { background-color: #e0f2fe; color: #0369a1; } /* Mainboard - Blue */