/* Inter font is loaded via <link> in app.py (preconnect + stylesheet) so it
   does NOT block CSS parsing the way @import url(...) does. */

/* ═══════════════════════════════════════════════
   GLOBAL
═══════════════════════════════════════════════ */
html, body, [data-testid="stAppViewContainer"] {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f4f8;
}
body {
    margin: 0;
    color: #1e293b;
}
a { color: #0078d4; text-decoration: none; }
a:hover { color: #005a9e; text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    padding: 24px 18px;
    box-sizing: border-box;
}
.main-content {
    width: min(1360px, calc(100vw - 300px));
    margin: 0 auto;
    padding: 14px 28px 48px;
    box-sizing: border-box;
}
.side-section {
    border-top: 1px solid #e2e8f0;
    margin-top: 18px;
    padding-top: 18px;
}
.side-section p { margin: 6px 0; font-size: 0.88rem; }
.side-section label,
.filters label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
}
.side-section input,
.side-section select,
.filters select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 10px;
    color: #0f172a;
    background: #ffffff;
}
.primary-action,
.secondary-action,
.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0 14px;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
}
.primary-action {
    width: 100%;
    color: #ffffff;
    background: #0078d4;
    box-shadow: 0 6px 18px rgba(0, 120, 212, 0.22);
}
.primary-action:disabled { opacity: 0.65; cursor: wait; }
.secondary-action,
.download-link {
    color: #005a9e;
    background: #eff6ff;
    border-color: #bfdbfe;
    margin-top: 10px;
}
.job-progress {
    margin-top: 12px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #ffffff;
    padding: 11px 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}
.job-progress.is-running {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}
.job-progress.is-complete { border-color: #bbf7d0; }
.job-progress.is-failed { border-color: #fecaca; }
.job-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.job-status {
    font-size: 0.78rem;
    color: #047857;
    font-weight: 800;
}
.job-error { color: #b91c1c; }
.job-elapsed {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    font-variant-numeric: tabular-nums;
}
.job-detail {
    margin: 7px 0 10px !important;
    color: #475569;
    font-size: 0.76rem !important;
    line-height: 1.45;
}
.job-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.job-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
}
.job-steps li::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    flex: 0 0 auto;
}
.job-steps li.is-active { color: #0f6cbd; }
.job-steps li.is-active::before {
    border-color: #0f6cbd;
    background: #0f6cbd;
    box-shadow: 0 0 0 4px rgba(15, 108, 189, 0.14);
}
.job-steps li.is-complete { color: #047857; }
.job-steps li.is-complete::before {
    border-color: #047857;
    background: #047857;
}
.muted { color: #64748b; font-size: 0.82rem; }
.compact-list { margin: 10px 0 0; padding-left: 18px; font-size: 0.84rem; color: #475569; }
.compact-list li { margin-bottom: 6px; }
.mini-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 1px 6px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
}
.web-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.web-hero.hero-wrap {
    border-radius: 10px;
    padding: 16px 28px;
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(0, 95, 163, 0.16), 0 1px 4px rgba(0,0,0,0.06);
}
.web-hero .hero-title {
    font-size: 1.55rem;
    letter-spacing: 0;
}
.web-hero .hero-sub {
    max-width: 720px;
    font-size: 0.86rem;
}
.hero-meta-label {
    color: rgba(255,255,255,0.62);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.web-hero .hero-timestamp {
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 0;
    font-size: 0.78rem;
}
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 16px 0 18px;
    border-bottom: 1px solid #dbe3ee;
    padding-bottom: 0;
}
.tab-button {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #475569;
    border-radius: 8px 8px 0 0;
    padding: 11px 13px 10px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
}
.tab-button.is-active {
    color: #0f172a;
    background: #ffffff;
    border-bottom-color: #0f6cbd;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── Microsoft Quarterly Analysis ── */
.quarterly-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 4px 0 12px;
}
.quarterly-toolbar .download-link { margin-top: 0; }
.quarterly-toolbar .quarterly-generate {
    width: auto;
    margin-top: 0;
}
.quarterly-empty {
    margin-top: 4px;
}
.quarterly-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.quarterly-subnav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    padding: 8px;
}
.quarterly-link {
    text-align: left;
    border: 0;
    background: transparent;
    color: #334155;
    border-left: 3px solid transparent;
    border-radius: 6px;
    padding: 9px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
}
.quarterly-link:hover { background: #f1f5f9; }
.quarterly-link.is-active {
    background: #eff6ff;
    color: #0f172a;
    border-left-color: #0f6cbd;
}
.quarterly-content { min-width: 0; }
.quarterly-section-head { margin: 2px 0 14px; }
.quarterly-section-head h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
    font-weight: 800;
}
.quarterly-section-head p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.86rem;
}
.quarterly-chart {
    position: relative;
    height: 320px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}
.quarterly-chart-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    margin-bottom: 4px;
}
.quarterly-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    align-items: start;
}
.quarterly-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.quarterly-bullets { margin: 0; padding-left: 18px; }
.quarterly-bullets li { margin-bottom: 8px; font-size: 0.86rem; color: #334155; line-height: 1.45; }
.quarterly-group { margin-top: 16px; }
.quarterly-group-head {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    background: #f1f5f9;
    border-left: 4px solid #0f6cbd;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}
.quarterly-group-head span { font-weight: 600; color: #64748b; font-size: 0.82rem; }
.md-table tr.row-total th,
.md-table tr.row-total td {
    background: #eff6ff;
    font-weight: 800;
}
.heatmap-table td.heat-cell {
    text-align: center;
    font-weight: 700;
    border-color: #ffffff;
}
.heatmap-table th { text-align: center; }
@media (max-width: 900px) {
    .quarterly-layout { grid-template-columns: 1fr; }
    .quarterly-subnav { position: static; flex-direction: row; flex-wrap: wrap; }
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    gap: 18px;
}
.filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 220px;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 7px 12px;
    max-height: 170px;
    overflow-y: auto;
}
.check-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: #334155;
}
.check-grid input { width: auto; }
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.md-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 10px 0 12px;
}
.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    background: #ffffff;
}
.md-table th,
.md-table td {
    border: 1px solid #dbe3ee;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}
.md-table th {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 800;
}
.competitor-card-body .md-table {
    min-width: 760px;
}
.copy-block {
    margin: -8px 0 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}
.copy-block summary { cursor: pointer; font-weight: 700; color: #475569; }
.copy-block textarea {
    width: 100%;
    min-height: 180px;
    box-sizing: border-box;
    margin-top: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    color: #0f172a;
    background: #f8fafc;
}
.linkedin-section-heading {
    margin: 18px 0 14px;
}
.linkedin-section-heading h3 {
    margin: 0;
    color: #0f6cbd;
    font-size: 1rem;
    font-weight: 800;
}
.linkedin-card {
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05), 0 10px 28px rgba(15, 23, 42, 0.04);
    margin: 0 0 18px;
    overflow: hidden;
}
.linkedin-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: linear-gradient(90deg, #f8fafc 0%, #eff6ff 100%);
    border-bottom: 1px solid #dbeafe;
}
.linkedin-card-header h3 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.3;
}
.linkedin-post-label {
    color: rgba(255,255,255,0.75);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.opp-card-header--actions {
    justify-content: space-between;
}
.opp-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.copy-button {
    flex: 0 0 auto;
    min-height: 34px;
    border: 1px solid #0f6cbd;
    border-radius: 8px;
    background: #0f6cbd;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0 12px;
}
.copy-button--header {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.6);
    color: #ffffff;
}
.copy-button--header:hover {
    background: rgba(255,255,255,0.24);
}
.copy-button.is-copied {
    background: #047857;
    border-color: #047857;
}
.linkedin-field {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
}
.linkedin-field span,
.linkedin-link span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.linkedin-field p {
    margin: 0;
    color: #1e293b;
    line-height: 1.55;
}
.linkedin-field div > p,
.linkedin-link p { margin: 0; }
.linkedin-draft {
    margin: 16px 18px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0f6cbd;
    border-radius: 8px;
    color: #0f172a;
    line-height: 1.7;
}
.linkedin-draft p {
    margin: 0 0 12px;
}
.linkedin-draft p:last-child { margin-bottom: 0; }
.linkedin-draft-text p {
    margin: 0 0 10px;
}
.linkedin-draft-text p:last-child {
    margin-bottom: 0;
}
.linkedin-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px 18px;
    color: #1e293b;
}
.copy-source {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

@media (max-width: 980px) {
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; }
    .main-content { width: 100%; padding: 16px; }
    .web-hero { align-items: flex-start; flex-direction: column; }
    .hero-right { text-align: left; }
    .kpi-grid, .two-col, .filters, .article-grid { grid-template-columns: 1fr; }
    .linkedin-card-header { flex-direction: column; }
    .linkedin-field { grid-template-columns: 1fr; gap: 5px; }
}
[data-testid="stMain"] { background: #f0f4f8; }
[data-testid="block-container"] { padding-top: 0.5rem !important; }
[data-testid="stMainBlockContainer"] { padding-top: 0.5rem !important; }
/* Hide the header bar but keep it as a positioning context so the
   sidebar collapse/expand control inside it remains visible. */
header[data-testid="stHeader"] {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}
/* Only hide the right-side toolbar (deploy, hamburger, status) — NOT the
   whole header. Hiding all header children kills the sidebar toggle. */
[data-testid="stToolbar"],
[data-testid="stStatusWidget"],
[data-testid="stDecoration"],
#MainMenu {
    display: none !important;
}
/* Re-show the sidebar collapse/expand chevron so users can reopen
   the sidebar after collapsing it. */
header[data-testid="stHeader"] [data-testid="stSidebarCollapsedControl"],
header[data-testid="stHeader"] [data-testid="collapsedControl"],
[data-testid="stSidebarCollapsedControl"],
[data-testid="collapsedControl"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000 !important;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */
[data-testid="stSidebar"] {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    display: block !important;
    visibility: visible !important;
    min-width: 244px;
    transform: none !important;
}
[data-testid="stSidebar"] section { padding-top: 0.5rem; }
[data-testid="stSidebar"] * { color: #1e293b !important; }
[data-testid="stSidebar"] .stMarkdown p { font-size: 0.85rem; color: #475569 !important; }
/* Make sure the in-sidebar collapse button is visible too */
[data-testid="stSidebar"] [data-testid="stSidebarCollapseButton"],
[data-testid="stSidebar"] [data-testid="baseButton-headerNoPadding"] {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════════
   HERO BANNER
═══════════════════════════════════════════════ */
.hero-wrap {
    position: relative;
    background: linear-gradient(135deg, #005fa3 0%, #0078d4 45%, #2196f3 100%);
    border-radius: 16px;
    padding: 18px 36px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,120,212,0.22), 0 2px 8px rgba(0,0,0,0.08);
}
.hero-wrap::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    border-radius: 50%;
}
.hero-wrap::after {
    content: '';
    position: absolute;
    bottom: -80px; left: 30%;
    width: 340px; height: 200px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.07) 0%, transparent 70%);
}
.hero-eyebrow {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
    color: rgba(255,255,255,0.68); text-transform: uppercase; margin-bottom: 6px;
}
.hero-title {
    font-size: 1.7rem; font-weight: 800; color: #ffffff;
    margin: 0; line-height: 1.2; letter-spacing: -0.02em;
}
.hero-sub { font-size: 0.88rem; color: rgba(255,255,255,0.78); margin-top: 4px; font-weight: 400; }
.hero-right { text-align: right; }
.hero-timestamp {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 24px; padding: 7px 18px;
    color: #fff; font-size: 0.82rem; font-weight: 600;
    margin-bottom: 8px;
}
.hero-powered {
    font-size: 0.72rem; color: rgba(255,255,255,0.55);
    letter-spacing: 0.05em; text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   METRIC CARDS
═══════════════════════════════════════════════ */
.kpi-grid { display: flex; gap: 16px; margin-bottom: 28px; }
.kpi-card {
    flex: 1;
    background: #ffffff;
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05), 0 4px 18px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: #0f6cbd;
    border-radius: 8px 8px 0 0;
}
.kpi-icon { display: none; }
.kpi-value { font-size: 1.55rem; font-weight: 800; color: #0f172a; line-height: 1.05; }
.kpi-value--date { font-size: 1rem; line-height: 1.25; }
.kpi-label { font-size: 0.68rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px; }
.kpi-delta { font-size: 0.76rem; color: #475569; margin-top: 7px; font-weight: 500; }

/* ═══════════════════════════════════════════════
   SECTION LABELS
═══════════════════════════════════════════════ */
.sec-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.10em;
    text-transform: uppercase; color: #ffffff;
    margin: 22px 0 12px 0;
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(90deg, #475569 0%, #64748b 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    border-left: 4px solid #1e293b;
}
.sec-label--dev {
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 100%);
    border-left-color: #1e3a8a;
}
.sec-label--sig {
    background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
    border-left-color: #5b21b6;
}
.sec-label--lead {
    background: linear-gradient(90deg, #b45309 0%, #f59e0b 100%);
    border-left-color: #78350f;
}
.sec-label--mkt {
    background: linear-gradient(90deg, #047857 0%, #10b981 100%);
    border-left-color: #064e3b;
}

/* Color the bordered container that immediately follows a colored
   section label, plus its bullet markers, to reinforce the theme. */
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--dev) + [data-testid="stElementContainer"] [data-testid="stVerticalBlockBorderWrapper"] {
    border-color: #bfdbfe !important;
    box-shadow: 0 1px 3px rgba(29, 78, 216, 0.08);
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--dev) + [data-testid="stElementContainer"] li::marker {
    color: #1d4ed8; font-weight: 800;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--dev) + [data-testid="stElementContainer"] strong {
    color: #1e3a8a;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--sig) + [data-testid="stElementContainer"] [data-testid="stVerticalBlockBorderWrapper"] {
    border-color: #ddd6fe !important;
    box-shadow: 0 1px 3px rgba(124, 58, 237, 0.08);
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--sig) + [data-testid="stElementContainer"] li::marker {
    color: #7c3aed; font-weight: 800;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--sig) + [data-testid="stElementContainer"] strong {
    color: #5b21b6;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--lead) + [data-testid="stElementContainer"] [data-testid="stVerticalBlockBorderWrapper"] {
    border-color: #fde68a !important;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--lead) + [data-testid="stElementContainer"] li::marker {
    color: #b45309; font-weight: 800;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--mkt) + [data-testid="stElementContainer"] [data-testid="stVerticalBlockBorderWrapper"] {
    border-color: #a7f3d0 !important;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label--mkt) + [data-testid="stElementContainer"] li::marker {
    color: #047857; font-weight: 800;
}

/* Tighten bullet spacing inside brief sections */
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label) + [data-testid="stElementContainer"] ul {
    padding-left: 1.25rem; margin: 0.25rem 0;
}
[data-testid="stElementContainer"]:has(> .stMarkdown .sec-label) + [data-testid="stElementContainer"] li {
    margin-bottom: 0.55rem; line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   BRIEF PANELS
═══════════════════════════════════════════════ */
.panel {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    padding: 26px 30px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
    color: #1e293b;
    line-height: 1.78;
    font-size: 0.93rem;
}
.panel h2 {
    font-size: 1.15rem; font-weight: 700; color: #0f172a;
    border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 16px;
}
.panel h3 { font-size: 1rem; font-weight: 700; color: #0078d4; margin-top: 18px; }
.panel h4 {
    font-size: 0.95rem; font-weight: 700; color: #b45309;
    background: linear-gradient(90deg, #fffbeb, #ffffff);
    border-left: 3px solid #f59e0b;
    padding: 8px 14px; border-radius: 6px; margin: 16px 0 8px 0;
}
.panel strong { color: #0f172a; font-weight: 600; }
.panel a { color: #0078d4; font-weight: 500; text-decoration: none; border-bottom: 1px solid #bfdbfe; }
.panel a:hover { color: #005a9e; border-bottom-color: #0078d4; }
.panel p { margin: 0 0 10px 0; color: #334155; }
.panel ul, .panel ol { padding-left: 20px; color: #334155; }
.panel li { margin-bottom: 4px; }

/* ═══════════════════════════════════════════════
   HCL OPPORTUNITY CARDS
═══════════════════════════════════════════════ */
.opp-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 6px 24px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}
.opp-card:hover { box-shadow: 0 6px 24px rgba(0,120,212,0.13); transform: translateY(-2px); }
.opp-card-header {
    background: linear-gradient(90deg, #0078d4 0%, #1e88e5 100%);
    padding: 16px 22px;
    display: flex; align-items: center; gap: 12px;
}
.opp-card-num {
    background: rgba(255,255,255,0.2);
    border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.opp-card-title { font-size: 1rem; font-weight: 700; color: #ffffff; }
.opp-card-body { padding: 20px 22px; }

/* ═══════════════════════════════════════════════
   EVENT CARDS (Upcoming MS Events tab)
═══════════════════════════════════════════════ */
.event-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 6px 24px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}
.event-card:hover { box-shadow: 0 6px 24px rgba(0,120,212,0.13); transform: translateY(-2px); }
.event-card-header {
    background: linear-gradient(90deg, #0f6cbd 0%, #1976d2 60%, #42a5f5 100%);
    padding: 14px 22px;
    display: flex; align-items: center; gap: 10px;
}
.event-card-num {
    background: rgba(255,255,255,0.2);
    border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.event-card-title { font-size: 1.05rem; font-weight: 700; color: #ffffff; flex: 1; }
.event-status-badge {
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
}
.event-audience-tag {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.event-header-link {
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.event-header-link:hover { opacity: 0.85; text-decoration: underline; color: #ffffff !important; }
.event-sub-header {
    background: linear-gradient(90deg, #1565c0 0%, #1976d2 100%);
    padding: 6px 22px;
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.event-details-wrap { margin-top: 10px; }
.event-card-body { padding: 20px 22px; }
.event-field {
    display: flex; gap: 12px; margin-bottom: 14px;
    padding-bottom: 14px; border-bottom: 1px solid #f1f5f9;
}
.event-field:last-of-type { border-bottom: none; margin-bottom: 8px; padding-bottom: 0; }
.event-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; width: 24px; text-align: center; }
.event-field-inner { flex: 1; }
.event-field-label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 3px; color: #0078d4;
}
.event-field-text { font-size: 0.88rem; color: #334155; line-height: 1.6; }
.event-link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 8px; padding: 8px 18px;
    font-size: 0.85rem; font-weight: 600;
    color: #0078d4; background: #eef4fb;
    border: 1px solid #c7ddf3; border-radius: 8px;
    text-decoration: none; transition: all 0.2s ease;
}
.event-link:hover {
    background: #dbeafe; color: #005a9e;
    border-color: #93c5fd; transform: translateY(-1px);
    text-decoration: none;
}

/* Toggle details for leadership cards */
.toggle-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 14px 0 2px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #0078d4;
    background: linear-gradient(135deg, #eef4fb 0%, #e8f0fe 100%);
    border: 1px solid #c7ddf3;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,120,212,0.08);
}
.toggle-details-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #d0e4fd 100%);
    color: #005a9e;
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(0,120,212,0.15);
    transform: translateY(-1px);
}
.leadership-details {
    margin-top: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f7ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    animation: slideDown 0.25s ease-out;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.detail-field {
    display: flex;
    gap: 12px;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid #e8eef4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.detail-field:last-child { margin-bottom: 0; }
.detail-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; width: 24px; text-align: center; }
.detail-inner { flex: 1; }
.detail-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 3px;
}
.detail-text { font-size: 0.88rem; color: #334155; line-height: 1.6; }
.detail-text a { color: #0078d4; font-weight: 500; }
.label-impact   { color: #b45309; }
.label-advantage { color: #0369a1; }
.label-benefit  { color: #059669; }
.label-sell     { color: #7c3aed; }

/* LinkedIn post bodies — readable, post-style block */
.li-post-card { margin-bottom: 22px; }
.li-post-body {
    padding: 22px 26px 24px;
    font-size: 1.02rem;
    line-height: 1.65;
    color: #1e293b;
    background: #ffffff;
}
.li-post-body p { margin: 0 0 14px; font-size: 1.02rem; line-height: 1.65; }
.li-post-body p:last-child { margin-bottom: 0; }
.li-post-body strong { color: #0f172a; font-weight: 700; }
.li-post-body em { color: #334155; }
.li-post-body a {
    color: #0078d4; font-weight: 600; text-decoration: none;
    border-bottom: 1px solid rgba(0,120,212,0.35);
}
.li-post-body a:hover { border-bottom-color: #0078d4; }
.li-post-body ul { margin: 8px 0 14px; padding-left: 22px; }
.li-post-body li { margin-bottom: 6px; font-size: 1.02rem; line-height: 1.6; }
.li-post-body code {
    background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
    font-size: 0.92em; color: #0f172a;
}
.opp-field {
    display: flex; gap: 12px; margin-bottom: 14px;
    padding-bottom: 14px; border-bottom: 1px solid #f1f5f9;
}
.opp-field:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.opp-field-icon {
    font-size: 1.1rem; flex-shrink: 0;
    margin-top: 1px; width: 24px; text-align: center;
}
.opp-field-inner {}
.opp-field-label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 3px;
}
.opp-field-text { font-size: 0.88rem; color: #334155; line-height: 1.6; }
.opp-field-text a { color: #0078d4; font-weight: 500; }
.label-signal  { color: #0078d4; }
.label-market  { color: #d97706; }
.label-hcl     { color: #059669; }
.label-agent   { color: #7c3aed; }
.label-action  { color: #dc2626; }

/* ═══════════════════════════════════════════════
   ARTICLE CARDS
═══════════════════════════════════════════════ */
.art-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex; flex-direction: column; gap: 6px;
}
.art-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 16px rgba(0,120,212,0.1);
    transform: translateY(-1px);
}
.art-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.art-title { font-size: 0.91rem; font-weight: 600; color: #0f172a; flex: 1; line-height: 1.45; }
.art-meta { font-size: 0.73rem; color: #94a3b8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.art-source { font-weight: 600; color: #475569; }
.art-link a {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.78rem; font-weight: 600; color: #0078d4;
    text-decoration: none; letter-spacing: 0.01em;
}
.art-link a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   CATEGORY PILLS
═══════════════════════════════════════════════ */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 20px; padding: 2px 10px;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.04em; white-space: nowrap;
}
.pill-ai       { background: #f5f3ff; color: #5b21b6; border: 1px solid #ddd6fe; }
.pill-cloud    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pill-security { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.pill-workplace{ background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pill-developer{ background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.pill-corporate{ background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.pill-community{ background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.pill-default  { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* ═══════════════════════════════════════════════
   STAT BAR (articles count)
═══════════════════════════════════════════════ */
.stat-bar {
    font-size: 0.8rem; color: #64748b;
    padding: 8px 0; margin-bottom: 14px;
}
.stat-bar b { color: #0f172a; font-weight: 700; }

/* ═══════════════════════════════════════════════
   SIDEBAR BRAND
═══════════════════════════════════════════════ */
.sb-brand { font-size: 1.05rem; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; }
.sb-sub   { font-size: 0.75rem; color: #64748b; margin-top: 2px; }
.sb-badge {
    display: inline-block;
    background: #eff6ff; color: #1d4ed8;
    border: 1px solid #bfdbfe; border-radius: 6px;
    padding: 2px 8px; font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.04em; margin-top: 6px;
}

/* ═══════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════ */
[data-testid="stTabs"] [data-baseweb="tab-list"] {
    background: transparent; gap: 4px; border-bottom: 2px solid #e2e8f0;
}
[data-testid="stTabs"] [data-baseweb="tab"] {
    font-weight: 600; font-size: 0.88rem; color: #64748b;
    border-radius: 8px 8px 0 0; padding: 10px 20px;
    border: 1px solid transparent; border-bottom: none;
}
[data-testid="stTabs"] [aria-selected="true"] {
    color: #0078d4 !important; background: #ffffff !important;
    border-color: #e2e8f0 !important; border-bottom: 2px solid #ffffff !important;
}

/* ═══════════════════════════════════════════════
   RUN BUTTON
═══════════════════════════════════════════════ */
[data-testid="stButton"] > button[kind="primary"] {
    background: linear-gradient(135deg, #0078d4 0%, #1565c0 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0,120,212,0.35) !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.03em !important;
    color: #ffffff !important;
    padding: 12px 20px !important;
    transition: all 0.2s !important;
}
[data-testid="stButton"] > button[kind="primary"]:hover {
    box-shadow: 0 6px 20px rgba(0,120,212,0.45) !important;
    transform: translateY(-2px) !important;
}

/* ═══════════════════════════════════════════════
   MISC
═══════════════════════════════════════════════ */
[data-testid="stDivider"] { margin: 16px 0; }
.info-box {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #0078d4;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: #1e3a5f;
}
