/* IPO Hub — list + analyst detail. Inherits shell + tokens from screener.css. */

/* ---------- tabs ---------- */
.ipo-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 14px;
    flex-wrap: wrap;
}
.ipo-tab {
    background: var(--card);
    border: 1px solid var(--card-brd);
    color: var(--muted);
    font: 600 0.9rem/1 "Inter", sans-serif;
    padding: 9px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ipo-tab:hover { color: var(--txt); border-color: rgba(255, 255, 255, 0.18); }
.ipo-tab.on {
    color: #0a0b14;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    border-color: transparent;
}
.ipo-tab-n {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    opacity: 0.8;
    margin-left: 2px;
}
.ipo-updated {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--faint);
    font-family: "JetBrains Mono", monospace;
}

/* ---------- layout ---------- */
.ipo-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) 1fr;
    gap: 18px;
    align-items: start;
}
.ipo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 78vh;
    overflow-y: auto;
    padding-right: 4px;
}
.ipo-loading {
    color: var(--muted);
    padding: 24px 12px;
    text-align: center;
    font-size: 0.9rem;
}
.ipo-loading.down { color: var(--down); }

/* ---------- list cards ---------- */
.ipo-card {
    text-align: left;
    background: var(--card);
    border: 1px solid var(--card-brd);
    border-radius: 14px;
    padding: 13px 15px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
    color: var(--txt);
    display: block;
    width: 100%;
}
.ipo-card:hover { border-color: rgba(139, 92, 246, 0.5); transform: translateY(-1px); }
.ipo-card.sel {
    border-color: var(--violet);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.12), var(--card));
}
.ipo-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
.ipo-name { font-weight: 700; font-size: 0.96rem; line-height: 1.25; }
.ipo-sme {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--amber);
    border: 1px solid rgba(245, 182, 81, 0.5);
    border-radius: 5px;
    padding: 1px 5px;
    flex: none;
}
.ipo-card-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    font-size: 0.8rem;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
}
.ipo-band { color: var(--txt); font-weight: 700; }
.ipo-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.ipo-dates {
    font-size: 0.74rem;
    color: var(--faint);
    font-family: "JetBrains Mono", monospace;
}

/* ---------- status pills ---------- */
.ipo-pill {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
}
.ipo-pill.open { color: var(--up); background: var(--up-soft); }
.ipo-pill.up { color: var(--amber); background: rgba(245, 182, 81, 0.14); }
.ipo-pill.closed { color: var(--muted); background: rgba(255, 255, 255, 0.06); }

/* ---------- detail panel ---------- */
.ipo-detail {
    background: var(--card);
    border: 1px solid var(--card-brd);
    border-radius: var(--radius);
    padding: 22px 24px;
    min-height: 300px;
}
.ipo-detail-empty {
    color: var(--muted);
    text-align: center;
    padding: 60px 20px;
}
.ipo-d-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--card-brd);
    padding-bottom: 16px;
}
.ipo-d-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.15;
}
.ipo-d-sym {
    margin-top: 5px;
    color: var(--muted);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
}

/* ---------- verdict banner ---------- */
.ipo-verdict {
    margin: 18px 0;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--card-brd);
    border-left-width: 4px;
}
.ipo-verdict-call { font-size: 1.15rem; font-weight: 800; }
.ipo-verdict-sum { margin-top: 5px; font-size: 0.88rem; color: var(--muted); }
.ipo-verdict.buy { border-left-color: var(--up); background: var(--up-soft); }
.ipo-verdict.buy .ipo-verdict-call { color: var(--up); }
.ipo-verdict.avoid { border-left-color: var(--down); background: var(--down-soft); }
.ipo-verdict.avoid .ipo-verdict-call { color: var(--down); }
.ipo-verdict.neutral { border-left-color: var(--amber); background: rgba(245, 182, 81, 0.1); }
.ipo-verdict.neutral .ipo-verdict-call { color: var(--amber); }
.ipo-verdict.wait { border-left-color: var(--violet); background: rgba(139, 92, 246, 0.1); }
.ipo-verdict.wait .ipo-verdict-call { color: #a78bfa; }

/* ---------- key facts ---------- */
.ipo-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}
.ipo-fact {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-brd);
    border-radius: 10px;
    padding: 10px 12px;
}
.ipo-fact span {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    font-weight: 700;
}
.ipo-fact b {
    display: block;
    margin-top: 4px;
    font-size: 0.92rem;
    font-family: "JetBrains Mono", monospace;
}

/* ---------- sections ---------- */
.ipo-sec { margin-top: 22px; }
.ipo-sec h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.ipo-sec h3 em {
    font-style: normal;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.82rem;
    color: var(--up);
    font-weight: 700;
}
.ipo-muted { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.ipo-muted a { color: #a78bfa; }

/* ---------- subscription meter + category bars ---------- */
.ipo-meter {
    position: relative;
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-bottom: 16px;
}
.ipo-meter-fill { height: 100%; border-radius: 6px; transition: width 0.4s ease; }
.ipo-meter-fill.buy { background: linear-gradient(90deg, #16d195, #0ea371); }
.ipo-meter-fill.neutral { background: linear-gradient(90deg, #f5b651, #e0952f); }
.ipo-meter-fill.avoid { background: linear-gradient(90deg, #ff5d6c, #e23c4c); }
.ipo-meter-1x {
    position: absolute;
    top: -3px;
    bottom: -3px;
    left: 25.4%; /* log10(2)/log10(51) — the "1× fully subscribed" mark */
    width: 2px;
    background: rgba(255, 255, 255, 0.4);
}
.ipo-cats { display: flex; flex-direction: column; gap: 12px; }
.ipo-cat-h {
    display: flex;
    justify-content: space-between;
    font-size: 0.84rem;
    margin-bottom: 5px;
}
.ipo-cat-h b { font-family: "JetBrains Mono", monospace; }
.ipo-cat-h b.buy { color: var(--up); }
.ipo-cat-h b.neutral { color: var(--amber); }
.ipo-cat-h b.avoid { color: var(--down); }
.ipo-cat-bar {
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}
.ipo-cat-bar span { display: block; height: 100%; border-radius: 5px; transition: width 0.4s ease; }
.ipo-cat-bar span.buy { background: var(--up); }
.ipo-cat-bar span.neutral { background: var(--amber); }
.ipo-cat-bar span.avoid { background: var(--down); }

/* ---------- about the company ---------- */
.ipo-about { border-left: 3px solid var(--violet); padding: 2px 0 2px 14px; }
.ipo-about-inf {
    font-style: normal;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--amber);
    background: rgba(245, 182, 81, 0.14);
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
}
.ipo-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ipo-tag {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--violet);
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    padding: 3px 10px;
}
.ipo-about-txt { margin: 0; font-size: 0.9rem; line-height: 1.6; color: #cfd3e0; }

/* ---------- reasons / risks lists ---------- */
.ipo-reasons { margin: 0; padding-left: 20px; }
.ipo-reasons li { margin-bottom: 8px; font-size: 0.88rem; line-height: 1.5; color: #cfd3e0; }
.ipo-reasons li b { color: var(--txt); }
.ipo-risks h3 { color: var(--amber); }
.ipo-fund { border-top: 1px solid var(--card-brd); padding-top: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .ipo-layout { grid-template-columns: 1fr; }
    .ipo-list { max-height: none; order: 2; }
    .ipo-detail { order: 1; }
}
