:root {
    /* --- LIGHT MODE PALETTE --- */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --border-color: #e2e8f0;

    --text-main: #0f172a;
    --text-body: #334155;
    --text-muted: #94a3b8;

    --green: #10b981;
    --green-bg: #d1fae5;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --dark-amber: #975106;
    --grey-dark: #2b2c2e;

    --font-serif: "Merriweather", serif;
    --font-sans: "Inter", sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --ease-spring: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.scrollable {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
}

/* --- HEADER --- */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 50;
}

.brand {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.search {
    background: var(--bg-body);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    width: 250px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center; /* Changed from justify-content: space-between */
    position: relative; /* Added for dropdown positioning */
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Existing legacy class, keeping just in case */
.search-input {
    margin-left: 14px;
    font-size: 14px;
    padding: 7px 14px 7px 7px;
    border: 1px solid #eee;
    border-radius: 7px;
    outline: none;
    width: 170px;
}
.search-input:focus {
    border-color: var(--text-main);
}

/* New Search Input Styling */
.stock-search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-main);
    margin-left: 8px;
}
.stock-search-input::placeholder {
    color: var(--text-muted);
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    padding: 6px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s;
}
.search-dropdown.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-result-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.15s;
    color: var(--text-body);
    font-size: 13px;
    text-decoration: none;
}
.search-result-item:hover, .search-result-item.active {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.search-result-item .symbol {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-main);
    min-width: 45px;
}
.search-result-item .name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-item .tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.search-result-item.sector .name {
    font-weight: 600;
    color: var(--blue);
}

.search-no-results {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* --- LAYOUT CONTAINER --- */
.app-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* SIDEBAR REMOVED - Legacy styles kept if needed, but overridden by new layout */
.sidebar {
    display: none; /* Hidden effectively */
}

/* STOCK INFO CARD (Top Bar) */
.stock-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color); /* Full border */
    border-radius: 16px; /* Rounded card */
    margin: 24px 24px 12px 24px; /* Detached from header */
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 40;
    order: -1 !important; /* Force to top */
    height: auto; /* Flexible height */
    min-height: 100px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* SECTOR INFO CARD */
.sector-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin: 24px 24px 12px 24px;
    padding: 20px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    z-index: 40;
    order: -1 !important;
    height: auto;
    min-height: 100px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.sector-info-main {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sector-info-card .sector-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.sector-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.sector-info-card .sector-badge {
    align-self: center;
}

.stock-info-main {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
    min-width: 0;
}

.stock-logo-container {
    height: 60px; /* Fixed height */
    width: auto; /* Width adjusts to image aspect ratio */
    min-width: 60px;
    border-radius: 8px;
    background: var(--bg-body); /* Subtle bg for transparent logos */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    /* border: 1px solid var(--border-color);  Removed border for cleaner look if logo has bg */
}

.stock-logo-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
    max-width: 120px; /* Limit width for very wide logos */
}

.vertical-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    flex-shrink: 0;
}

.stock-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
}

.sector-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--blue);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    align-self: flex-start;
    /* text-transform: uppercase; REMOVED */
}

.stock-symbol {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stock-name {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.stock-oneliner-container {
    flex: 1;
    min-width: 0;
    padding-left: 12px;
}

.stock-oneliner {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.6;
    display: -webkit-box;
    line-clamp: 2; /* Reduced to 2 lines for cleaner look */
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 700px;
    font-weight: 400;
}

.stock-info-right {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-shrink: 0;
    padding-left: 24px;
}

.stock-price-container {
    display: flex;
    align-items: baseline; /* Align baseline for better typography match */
    gap: 12px;
}

.stock-info-card .price-hero {
    font-family: var(--font-sans); /* Use sans for cleaner numbers */
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
    letter-spacing: -1.5px;
}

.stock-info-card .price-diff {
    font-family: var(--font-mono); /* Mono for tabular alignment feeling */
    font-size: 16px;
    font-weight: 600;
    padding: 0;
    border-radius: 0;
    background: transparent; /* No background */
    display: flex;
    align-items: center;
    gap: 4px;
}

/* MAIN COLUMN WRAPPER */
.main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Enable scrolling for the whole column */
    min-width: 0;
    transition: flex 0.5s var(--ease-spring);
}

/* CONTENT WRAPPER */
.content-wrapper {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* --- DASHBOARD VIEW (Dynamic) --- */
/* Updated to be children of main-column */
.dashboard-view, .sector-view, .ipo-view {
    flex: 0 0 auto; /* Let content dictate height */
    padding: 24px;
    overflow-y: visible; /* Remove independent scroll */
    min-width: unset; /* Let container handle it */
}

/* Shrink State - Target Main Column now */
.app-container.news-active .main-column {
    flex: 0 0 65%;
}

/* Reset old selectors */
.app-container.news-active .dashboard-view, 
.app-container.news-active .sector-view,
.app-container.news-active .ipo-view {
    flex: 1;
}

/* --- NEWS PANEL (Right Side) --- */
.news-panel {
    position: relative;
    width: 0;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    /* More damped, smoother transitions */
    transition: width 1.2s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.app-container.news-active .news-panel {
    width: 35%;
    opacity: 1;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.05);
}

/* --- GRID SYSTEM --- */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default 3 cols */
    gap: 20px;
    transition: all 0.5s;
}

/* IPO Layout (Flexbox for individual sizing) */
.ipo-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start; /* Prevents height stretching */
}

.ipo-layout .card {
    flex: 0 0 auto; /* Prevent automatic growing/shrinking */
}

/* Specific sizes for IPO cards */
#ipoProceedsCard, 
#ipoSegmentsCard, 
#ipoCustomersCard,
#ipoRevenueFyeCard,
#ipoRevenueFpeCard,
#ipoPatFyeCard,
#ipoPatFpeCard,
#analystReportCard_ipo,
#aiTargetPriceCard_ipo {
    width: 480px; /* Standard width for charts and lists */
}

#ipoSwotCard,
#ipoHighlightsCard {
    width: 100%; /* Full width for SWOT and Highlights */
}

#ipoCustomerDeductionCard {
    width: 100%; /* Full width for the deduction grid */
}

/* Grid adjusts to 2 cols when shrunk to fit widgets better */
.app-container.news-active .grid-layout {
    grid-template-columns: repeat(2, 1fr);
}

.col-span-2 {
    grid-column: span 2;
}
.col-span-3 {
    grid-column: span 3;
}
/* When grid shrinks to 2 cols, col-span-3 elements become col-span-2 */
.app-container.news-active .col-span-3 {
    grid-column: span 2;
}

/* --- WIDGET STYLES --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

#priceChart {
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.card-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.bg-pill {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}
.bg-green {
    background: var(--green-bg);
    color: var(--green);
}
.bg-amber {
    background: #fff7ed;
    color: var(--amber);
}
.bg-blue {
    background: #eff6ff;
    color: var(--blue);
}

/* NEWS STRIP */
.news-strip {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: visible; /* Allow cards to expand on hover */
    padding: 8px 24px 12px 24px; /* top right bottom left (clockwise from top) */
    margin: 12px 0 12px 0;
    order: 0 !important; /* Force below stock card */
    flex-shrink: 0;
    min-height: 80px;
}
.news-card-small {
    min-width: 260px;
    max-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.news-card-small:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
}
.news-card-small.active-card {
    border-color: var(--text-main);
    background: var(--bg-hover);
}
.news-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.news-headline {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
}

/* DATA WIDGETS CSS */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-hover);
    font-size: 13px;
    color: var(--text-body);
}
.stat-val {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-main);
}

/* Sector Rank */
.rank-badge {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-mono);
}
.peer-bar-bg {
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    width: 80px;
}
.peer-bar {
    height: 100%;
    background: var(--text-main);
}

/* Corporate Orderbook */
.project-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}
.p-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}
.p-sub {
    font-size: 10px;
    color: var(--text-muted);
}
.p-bar-bg {
    height: 4px;
    background: var(--bg-hover);
    width: 100%;
    margin-top: 6px;
    border-radius: 2px;
}
.p-bar-fill {
    height: 100%;
    background: var(--text-main);
    border-radius: 2px;
}

/* News Panel Content */
.np-content {
    padding: 30px;
    min-width: 350px;
}
.np-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.np-tag {
    display: inline-block;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-body);
    margin-bottom: 10px;
}
.np-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
}
.np-body {
    font-family: var(--font-serif);
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-body);
}
.close-panel {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    z-index: 10;
}

/* Utility classes */
.text-green {
    color: var(--green);
}
.text-red {
    color: var(--red);
}
.text-amber {
    color: var(--amber);
}
.text-blue {
    color: var(--blue);
}

/* --- SETTINGS MENU --- */
.settings-menu {
    position: fixed;
    top: 135px; /* Below Header (60) + StockCard (70) + gap */
    right: 24px;
    width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    display: none; /* Hidden by default */
    transform-origin: top right;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.settings-menu.active {
    display: block;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.settings-item {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.settings-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

/* Submenu Flyout */
.settings-submenu {
    position: absolute;
    right: 100%; /* Opens to the left */
    top: 0;
    margin-right: 4px;
    width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    padding: 8px 0;
}

/* Invisible bridge to prevent closing when moving mouse */
.settings-submenu::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -20px; /* Covers gap on the right */
    width: 25px;
    background: transparent;
}

.settings-item.has-submenu:hover .settings-submenu {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(5px); }
    to { opacity: 1; transform: translateX(0); }
}

.submenu-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--bg-hover);
    margin-bottom: 4px;
}

.submenu-item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-body);
}

.submenu-item:hover {
    background: var(--bg-hover);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--green);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--green);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* Header Preferences Dropdown */
.header-prefs-container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0 8px;
}

.header-prefs-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-card);
    min-width: 220px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 100;
    padding: 8px 0;
    /* Use padding-top instead of margin-top to maintain hover connection */
    padding-top: 13px;
    margin-top: 0;
}

/* Invisible bridge to connect trigger to dropdown */
.header-prefs-dropdown::before {
    content: "";
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

.header-prefs-container:hover .header-prefs-dropdown {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* --- LANDING PAGE --- */
.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3.5rem;
    line-height: 1.6;
    font-weight: 300;
}

.cta-button {
    background-color: var(--text-main);
    color: var(--bg-card);
    padding: 16px 36px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s var(--ease-spring);
    border: 1px solid var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.cta-button:hover {
    background-color: transparent;
    color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto 80px auto;
    padding: 0 20px;
}

.feature-item {
    text-align: center;
    padding: 30px;
    border-radius: 12px;
    transition: 0.3s;
}

.feature-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 24px;
    color: var(--green);
    margin-bottom: 20px;
    background: var(--green-bg);
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.feature-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.feature-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Animations */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- MOCK PORTFOLIO WIDGET --- */
.portfolio-container {
    display: flex;
    justify-content: center;
    padding-top: 100px;
    opacity: 0;
    animation: fadeIn 1s 0.2s forwards;
}

.portfolio-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    width: 380px;
    padding: 24px;
}

.pw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pw-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
}

.pw-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-hover);
}

.pw-row:last-child {
    border-bottom: none;
}

.pw-symbol {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
}

.pw-name {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.pw-price {
    text-align: right;
}

.pw-val {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.pw-change {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}

/* SWOT Analysis Grid Layout */
.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .swot-grid {
        grid-template-columns: 1fr;
    }
}

/* Highlight Card Text Expansion */
.highlight-text {
    transition: all 0.3s ease;
}

.highlight-text.collapsed {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.highlight-toggle {
    font-size: 10px;
    color: var(--blue);
    cursor: pointer;
    margin-top: 6px;
    align-self: flex-start;
    font-weight: 600;
}

.highlight-toggle:hover {
    text-decoration: underline;
}

/* --- REDESIGNED IPO HIGHLIGHTS --- */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    padding: 8px 0;
}

.highlight-card-new {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.highlight-card-new:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.1);
    border-color: var(--text-muted);
}

.highlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.highlight-category-badge {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-hover);
    color: var(--text-body);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Sentiment Dot in Badge */
.h-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.h-dot.pos { background-color: var(--green); box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15); }
.h-dot.neg { background-color: var(--red); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15); }
.h-dot.neu { background-color: var(--amber); }

.highlight-hook-text {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 400;
    color: var(--text-body);
    line-height: 1.6;
    margin-bottom: 16px;
    
    /* Clamp to 3 lines for the 'hook' effect */
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Important terms highlight */
.highlight-hook-text strong {
    font-weight: 700;
    color: var(--text-main);
}

/* When expanded, show all text */
.highlight-card-new.expanded .highlight-hook-text {
    display: block;
    line-clamp: unset;
    -webkit-line-clamp: unset;
}

.highlight-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid transparent; /* Placeholder for transition */
    transition: border-color 0.3s;
}

.highlight-card-new:hover .highlight-actions {
    border-top-color: var(--bg-hover);
}

.highlight-read-more {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.highlight-read-more:hover {
    color: var(--text-main);
}

.highlight-read-more i {
    transition: transform 0.3s;
    font-size: 10px;
}

.highlight-card-new.expanded .highlight-read-more i {
    transform: rotate(180deg);
}