:root {
    --chat-bg: #f6f8fb;
    --chat-card: #ffffff;
    --chat-border: #e5eaf1;
    --chat-text: #17212f;
    --chat-muted: #66758a;
    --chat-user: #dbeafe;
    --chat-assistant: #ffffff;
    --chat-system: #fff7e6;
    --chat-accent: #2563eb;
    --chat-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --chat-radius: 18px;
}

body {
    background: #f7f9fb;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--brand);
}

.mobile-menu-panel .menu > li > a.nav-link-active {
    color: blue !important;
}

.logo-image {
    max-width: 50%
}

.nav-link-active {
    color: blue !important;
    font-weight: 600;
}

.nav-link-active:hover,
.nav-link-active:focus {
    color: blue !important;
}

.chat-shell {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
    min-height: calc(100vh - 4rem);
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}

.logo_menu {
    width: 20%;
    height: 20%;
    margin-top: 0;
    margin-bottom: 0;
}

.shell-bar {
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 24px rgba(18, 50, 74, .04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.75rem;
    padding: 0 1rem;
}

.brand a,
.brand {
    color: var(--brand) !important;
    font-weight: 700;
    letter-spacing: .02em;
}

.card-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.4rem;
    box-shadow: 0 10px 30px rgba(18, 50, 74, .06);
    margin-bottom: 1rem;
}

.hero {
    padding: 2.8rem;
    background: linear-gradient(180deg, #ffffff, #f3f7fa);
}

.lead {
    font-size: 1.15rem;
    color: #3a4b59;
    max-width: 50rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.stat strong {
    font-size: 2rem;
    color: var(--brand);
}

.stat span {
    color: var(--muted);
}


.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
}

.page-pad {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.chat-header-card,
.chat-input-card {
    background: var(--chat-card);
    border: 1px solid var(--chat-border);
    border-radius: 22px;
    box-shadow: var(--chat-shadow);
}

.chat-header-card {
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
}

.chat-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--chat-text);
}

.chat-subtitle {
    margin-top: 0.35rem;
    color: var(--chat-muted);
    font-size: 1rem;
}

.chat-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}

.chat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #eef4ff;
    color: #31558b;
    font-size: 0.85rem;
    border: 1px solid #dbe7fb;
}

.chat-messages {
    background: rgba(255,255,255,0.42);
    border-radius: 22px;
    padding: 1rem 0.15rem 1rem 0.15rem;
    min-height: 420px;
    max-height: 68vh;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.chat-row {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.15rem;
    align-items: flex-start;
}

.chat-row-user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.86rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.chat-avatar-user {
    background: #dbeafe;
    color: #1e40af;
}

.chat-avatar-assistant {
    background: #111827;
    color: #fff;
}

.chat-bubble {
    max-width: min(78%, 920px);
    border-radius: var(--chat-radius);
    padding: 1rem 1.1rem;
    border: 1px solid var(--chat-border);
    box-shadow: var(--chat-shadow);
    background: var(--chat-card);
}

.chat-bubble.user {
    background: var(--chat-user);
    border-color: #bfdbfe;
}

.chat-bubble.assistant {
    background: var(--chat-assistant);
}

.chat-bubble.system {
    background: var(--chat-system);
}

.chat-role {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--chat-text);
    margin-bottom: 0.55rem;
}

.chat-content {
    color: var(--chat-text);
    line-height: 1.65;
    font-size: 1rem;
}

.chat-citations {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid #e8edf4;
}

.chat-citations-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--chat-muted);
}

.chat-citations ul {
    margin: 0;
    padding-left: 1.2rem;
}

.chat-input-card {
    padding: 1rem;
    position: sticky;
    bottom: 1rem;
}

.chat-input-wrap {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
}

.chat-textarea {
    margin: 0 !important;
    min-height: 56px;
    max-height: 220px;
    resize: none;
    border-radius: 18px !important;
    border: 1px solid var(--chat-border) !important;
    background: #fbfcfe !important;
    box-shadow: none !important;
    padding: 0.95rem 1rem !important;
    line-height: 1.5;
}

.chat-textarea:focus {
    border-color: #9ec0ff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08) !important;
}

.chat-send-button {
    height: 54px;
    border-radius: 16px !important;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
    margin-bottom: 0 !important;
    min-width: 120px;
}

.chat-input-help {
    margin-top: 0.65rem;
    font-size: 0.86rem;
    color: var(--chat-muted);
}

.empty-chat-state {
    background: #fff;
    border: 1px dashed #d8e2ee;
    border-radius: 22px;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--chat-muted);
}

.empty-chat-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.markdown-body p {
    margin-bottom: 0.85rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
    color: #0f172a;
}

.markdown-body ul,
.markdown-body ol {
    margin-left: 1.35rem;
    margin-bottom: 0.85rem;
}

.markdown-body blockquote {
    border-left: 4px solid #cfd8e3;
    padding-left: 0.9rem;
    color: #475569;
    margin: 0.8rem 0;
}

.markdown-body code {
    background: #edf2f8;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.92em;
}

.code-block-wrap {
    margin: 1rem 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #1f2937;
    background: #111827;
}

.code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0b1220;
    color: #d1d5db;
    padding: 0.55rem 0.8rem;
    font-size: 0.82rem;
}

.code-label {
    opacity: 0.9;
}

.code-copy-button {
    background: #1f2937;
    color: #fff;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.78rem;
}

.code-copy-button:hover {
    background: #273244;
}

.markdown-body pre {
    background: #111827;
    color: #f9fafb;
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.mobile-menu-wrap {
    display: none;
    position: relative;
    align-items: center;
}

.mobile-menu-toggle {
    margin: 0;
    padding: 0.5rem;
    line-height: 1;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.thinking {
    color: var(--chat-muted);
    font-style: italic;
}

.thinking::after {
    content: "";
    display: inline-block;
    width: 1.2em;
    animation: chatDots 1.2s steps(3, end) infinite;
}

@keyframes chatDots {
    0% { content: ""; }
    33% { content: "."; }
    66% { content: ".."; }
    100% { content: "..."; }
}

@media screen and (max-width: 640px) {
    .chat-bubble {
        max-width: calc(100% - 54px);
    }

    .chat-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-send-button {
        width: 100%;
    }
}
/* selfAI public homepage */
:root {
    --brand: #12324a;
    --brand-2: #2563eb;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f1f5f9;
    --dark: #0f172a;
}
.site-topline { background:#0f172a; color:#dbeafe; font-size:.86rem; padding:.45rem 0; }
.site-topline a { color:#fff; }
.top-contact { display:flex; gap:.9rem; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.language-form { display:flex; align-items:center; gap:.25rem; margin:0; }
.lang-link { background:transparent; border:0; color:#dbeafe; padding:0; cursor:pointer; font-size:.86rem; }
.lang-link.active { color:#fff; font-weight:700; text-decoration:underline; }
.selfai-nav { background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); box-shadow:0 8px 24px rgba(15,23,42,.04); padding:.75rem 1rem; }
.selfai-nav a { color:var(--brand); font-weight:600; }
.selfai-nav .button { margin-bottom:0; }
.hero-home { background:linear-gradient(135deg,#ffffff 0%,#eef6ff 55%,#e8efff 100%); padding:6rem 0 5rem; overflow:hidden; }
.eyebrow { color:var(--brand-2); font-weight:800; letter-spacing:.08em; text-transform:uppercase; font-size:.82rem; margin-bottom:.8rem; }
.hero-home h1 { color:var(--dark); font-size:clamp(2.4rem,5vw,4.8rem); line-height:1.02; font-weight:800; margin-bottom:1.3rem; }
.hero-lead { color:#334155; font-size:1.25rem; line-height:1.7; max-width:46rem; }
.hero-actions { display:flex; gap:.8rem; flex-wrap:wrap; margin-top:2rem; }
.hero-card { background:#fff; border:1px solid var(--line); border-radius:28px; padding:2rem; box-shadow:0 24px 70px rgba(15,23,42,.12); }
.check-list { list-style:none; margin-left:0; }
.check-list li { padding:.55rem 0 .55rem 2rem; position:relative; color:#334155; }
.check-list li:before { content:'✓'; position:absolute; left:0; top:.45rem; color:#16a34a; font-weight:800; }
.focus-strip { margin-top:-2.2rem; position:relative; z-index:2; }
.focus-item { background:#fff; border:1px solid var(--line); border-radius:20px; padding:1.25rem; box-shadow:0 14px 35px rgba(15,23,42,.08); min-height:104px; }
.focus-item strong { display:block; color:var(--brand); font-size:1.25rem; margin-bottom:.25rem; }
.focus-item span { color:var(--muted); }
.content-section { padding:5rem 0; }
.muted-section { background:#f8fafc; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.section-heading { text-align:center; max-width:720px; margin:0 auto 2.4rem; }
.section-heading h2, .content-section h2 { color:var(--dark); font-weight:800; }
.feature-card, .process-card, .callout-card, .legal-card { background:#fff; border:1px solid var(--line); border-radius:22px; padding:1.5rem; box-shadow:0 10px 30px rgba(15,23,42,.05); margin-bottom:1rem; height:calc(100% - 1rem); }
.feature-card h4, .callout-card h4 { color:var(--brand); font-weight:800; }
.feature-card p, .process-card p, .callout-card p { color:#475569; line-height:1.65; }
.process-card span { width:42px; height:42px; border-radius:50%; background:#e0edff; color:var(--brand-2); display:inline-flex; align-items:center; justify-content:center; font-weight:800; margin-bottom:1rem; }
.process-card h5 { font-weight:800; color:var(--dark); }
.cta-section { padding:5rem 0; background:linear-gradient(135deg,#12324a,#1d4ed8); color:#fff; }
.cta-section h2 { color:#fff; font-weight:800; }
.cta-section p { font-size:1.15rem; color:#dbeafe; }
.legal-hero { background:linear-gradient(135deg,#12324a,#1e40af); color:#fff; padding:4rem 0; }
.legal-hero h1 { color:#fff; font-weight:800; }
.legal-card { height:auto; max-width:920px; }
.legal-card h3 { color:var(--brand); font-weight:800; margin-top:1.6rem; }
.site-footer { background:#0f172a; color:#cbd5e1; padding:3.5rem 0 1.5rem; }
.site-footer h5 { color:#fff; font-weight:800; }
.site-footer a { color:#dbeafe; }
.footer-links li { margin-bottom:.35rem; }
.footer-bottom { margin-bottom:0; color:#94a3b8; font-size:.9rem; }
.mobile-menu-panel { display:none; position:absolute; top:3.5rem; left:1rem; right:1rem; background:#fff; border:1px solid var(--line); border-radius:16px; padding:1rem; box-shadow:0 20px 45px rgba(15,23,42,.15); z-index:10; }
.mobile-menu-panel.is-open { display:block; }
@media print { .site-topline, .selfai-nav, .site-footer { display:none; } .content-section { padding:1rem 0; } }


/* BS-PK CI refinement + selfAI Machine Learning */
:root {
    --brand: #184573;
    --brand-2: #1f6fb2;
    --brand-deep: #111d32;
    --brand-warm: #f3f7fb;
    --accent: #58a6d6;
    --muted: #66758a;
    --line: #dfe8f1;
    --soft: #f6f9fc;
    --dark: #111d32;
}
body { background:#f6f9fc; color:#111d32; }
a { color: var(--brand); }
.button, .button.primary { background-color: var(--brand); border-radius: 2px; font-weight: 700; }
.button:hover, .button:focus { background-color: var(--brand-deep); }
.button.hollow { color: var(--brand); border-color: var(--brand); background: transparent; }
.button.secondary { background-color: var(--accent); color: #fff; }
.site-topline { background: var(--brand-deep); color:#e7eef7; }
.selfai-nav { border-bottom: 1px solid #dce6ef; box-shadow: 0 6px 22px rgba(24,69,115,.08); }
.selfai-nav a { color: var(--brand-deep); }
.logo-image { max-width: 220px; height: auto !important; }
.hero-home, .ml-hero { background: linear-gradient(135deg,#ffffff 0%,#f3f8fc 50%,#e5eff8 100%); }
.hero-home h1, .ml-hero h1 { color: var(--brand-deep); }
.eyebrow { color: var(--brand); }
.feature-card, .process-card, .callout-card, .legal-card { border-color:#dfe8f1; box-shadow:0 10px 28px rgba(24,69,115,.07); }
.feature-card h4, .callout-card h4 { color: var(--brand); }
.cta-section { background: linear-gradient(135deg,var(--brand-deep),var(--brand)); }
.site-footer { background: var(--brand-deep); }

.ml-hero { padding: 5rem 0 4rem; border-bottom: 1px solid var(--line); }
.ml-hero h1 { font-size: clamp(2.1rem, 4vw, 4rem); font-weight: 800; line-height: 1.05; max-width: 820px; }
.ml-card { min-height: 250px; }
.ml-pill { display:inline-flex; align-items:center; background:#e6f0f8; color:var(--brand); border:1px solid #cdddea; border-radius:999px; padding:.32rem .7rem; font-size:.82rem; font-weight:700; margin:0 .35rem .7rem 0; }
.ml-summary { background:#0f172a; color:#e5edf7; border-radius:14px; padding:1rem; max-height:430px; overflow:auto; font-size:.86rem; white-space:pre-wrap; }
.ml-chart { width:100%; border:1px solid var(--line); border-radius:14px; background:#fff; }
.narrow-container { max-width: 820px; }
.muted { color: var(--muted); }
.menu .menu-text { color: var(--muted); font-size:.88rem; }
@media screen and (max-width: 1024px) {
    .mobile-menu-wrap { display:flex; }
    .desktop-menu-wrap { display:none !important; }
    .logo-image { max-width: 170px; }
}

/* Machine Learning workspace redesign */
.ml-workspace { background: #f5f8fb; padding: 3rem 0 4rem; }
.ml-page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:2rem; margin-bottom:2rem; }
.ml-page-head h1 { color: var(--brand-deep, #153f63); font-size: clamp(2rem, 3vw, 3.25rem); font-weight:800; margin-bottom:.4rem; }
.ml-page-head .lead { max-width: 820px; color:#4d6172; }
.ml-head-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:.45rem; min-width:220px; }
.ml-kpi-grid, .ml-business-grid { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:1rem; margin-bottom:1.4rem; }
.ml-kpi-card, .ml-business-card, .ml-panel { background:#fff; border:1px solid #dfe8f0; border-radius:22px; box-shadow:0 12px 36px rgba(23,63,99,.08); }
.ml-kpi-card { padding:1.1rem 1.25rem; }
.ml-kpi-card span, .ml-business-card span { color:#607487; font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; font-weight:700; }
.ml-kpi-card strong { display:block; color:#153f63; font-size:2rem; line-height:1.15; margin:.25rem 0; }
.ml-kpi-card small, .ml-business-card small { color:#6b7d8d; }
.ml-business-card { padding:1.2rem 1.35rem; background:linear-gradient(135deg,#ffffff 0%,#eef6fb 100%); }
.ml-business-card strong { display:block; color:#153f63; font-size:1.65rem; line-height:1.2; margin:.3rem 0; }
.ml-panel { padding:1.5rem; margin-bottom:1.4rem; }
.ml-panel h3 { color:#153f63; font-weight:800; margin-bottom:1rem; }
.ml-panel-title { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.ml-form label { color:#24384a; font-weight:700; margin-bottom:.35rem; }
.ml-form textarea, .ml-form input, .ml-form select { border-radius:12px; border-color:#cfdbe5; box-shadow:none; }
.ml-form textarea:focus, .ml-form input:focus, .ml-form select:focus { border-color:#437aa4; box-shadow:0 0 0 3px rgba(67,122,164,.12); }
.ml-chart-form .button, .ml-form .button { margin-top:.5rem; border-radius:999px; font-weight:700; }
.ml-answer-card, .ml-chart-card { border:1px solid #e1eaf1; border-radius:18px; padding:1rem; margin-bottom:1rem; background:#fbfdff; }
.ml-answer-card h5 { color:#153f63; font-weight:800; margin-bottom:.8rem; }
.ml-answer { color:#273d50; line-height:1.65; }
.ml-answer p:last-child { margin-bottom:0; }
.ml-chart-meta { display:flex; justify-content:space-between; gap:1rem; margin-bottom:.8rem; color:#607487; }
.ml-chart-meta strong { color:#153f63; }
.ml-column-cloud, .ml-missing-list { display:flex; flex-wrap:wrap; gap:.45rem; margin-bottom:1rem; }
.ml-column-cloud span, .ml-missing-list span { background:#eef4f8; border:1px solid #d9e6ee; color:#294d69; border-radius:999px; padding:.35rem .7rem; font-size:.82rem; font-weight:700; }
.ml-missing-list span { background:#fff7e8; border-color:#f1d9a8; color:#705218; }
.ml-table-scroll { overflow:auto; border:1px solid #e1eaf1; border-radius:16px; margin-top:1rem; }
.ml-preview-table { margin-bottom:0; font-size:.84rem; }
.ml-preview-table thead { background:#153f63; color:#fff; }
.ml-preview-table th, .ml-preview-table td { white-space:nowrap; }
.ml-raw-summary { margin-top:1.2rem; }
.ml-raw-summary summary { cursor:pointer; color:#153f63; font-weight:800; }
.ml-summary { margin-top:1rem; background:#10263a; color:#eaf2f8; border-radius:16px; padding:1rem; max-height:340px; overflow:auto; font-size:.84rem; white-space:pre-wrap; }
@media screen and (max-width: 1023px) { .ml-page-head { display:block; } .ml-head-actions { justify-content:flex-start; margin-top:1rem; } .ml-kpi-grid, .ml-business-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media screen and (max-width: 640px) { .ml-workspace { padding-top:2rem; } .ml-kpi-grid, .ml-business-grid { grid-template-columns:1fr; } .ml-panel { padding:1.1rem; } }
