/* Custom styles for chat markdown and citation badges - Authoritative Legal Blue Palette */
[x-cloak] { display: none !important; }

/* Global typography baseline */
body {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Touch & Tap UX Improvements */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent iOS Safari from auto-zooming on input focus */
@media screen and (max-width: 640px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* High-Contrast Markdown rendered text styling for Legal Opinion & RAG */
.prose-legal {
    color: #0f172a;
    line-height: 1.7;
    font-size: 0.9375rem;
    word-break: break-word;
    overflow-wrap: break-word;
}
@media (min-width: 640px) {
    .prose-legal {
        font-size: 0.975rem;
        line-height: 1.75;
    }
}

.prose-legal h1, .prose-legal h2, .prose-legal h3, .prose-legal h4 {
    color: #0c3d6d;
    font-weight: 700;
    margin-top: 1.15rem;
    margin-bottom: 0.45rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    line-height: 1.35;
}
.prose-legal h1 { font-size: 1.25rem; color: #082749; }
.prose-legal h2 { font-size: 1.15rem; color: #0c3d6d; }
.prose-legal h3 {
    font-size: 1.05rem;
    color: #026cc4;
}
.prose-legal h4 { font-size: 0.95rem; color: #074883; }

.prose-legal p {
    margin-bottom: 0.85rem;
    color: #0f172a;
    font-weight: 450;
}
.prose-legal p:last-child {
    margin-bottom: 0;
}

.prose-legal ul, .prose-legal ol {
    margin-left: 1.25rem;
    margin-bottom: 0.85rem;
    list-style-position: outside;
    color: #1e293b;
}
@media (min-width: 640px) {
    .prose-legal ul, .prose-legal ol {
        margin-left: 1.5rem;
    }
}
.prose-legal ul { list-style-type: disc; }
.prose-legal ol { list-style-type: decimal; }

.prose-legal li {
    margin-bottom: 0.35rem;
    color: #1e293b;
    line-height: 1.65;
}
.prose-legal strong {
    color: #082749;
    font-weight: 800;
}
.prose-legal em {
    color: #0c3d6d;
    font-style: italic;
}
.prose-legal blockquote {
    border-left: 3.5px solid #026cc4;
    color: #1e293b;
    margin-top: 0.85rem;
    margin-bottom: 0.85rem;
    background: #f0f7ff;
    padding: 0.75rem 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    word-break: break-word;
    border-top: 1px solid #e0effe;
    border-right: 1px solid #e0effe;
    border-bottom: 1px solid #e0effe;
}
@media (min-width: 640px) {
    .prose-legal blockquote {
        padding: 0.85rem 1.15rem;
        font-size: 0.925rem;
    }
}

/* Tables inside markdown */
.prose-legal table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.85rem 0;
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.prose-legal th, .prose-legal td {
    padding: 0.55rem 0.85rem;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
.prose-legal th {
    background-color: #f1f5f9;
    color: #082749;
    font-weight: 700;
}
.prose-legal tr:nth-child(even) {
    background-color: #f8fafc;
}

/* Diff viewer styles */
table.diff {
    width: 100%;
    font-family: monospace;
    font-size: 12px;
    border-collapse: collapse;
}
table.diff td {
    padding: 2px 6px;
    white-space: pre-wrap;
    word-break: break-all;
}
table.diff .diff_header {
    background-color: #f1f5f9;
    color: #475569;
    text-align: right;
    user-select: none;
    width: 40px;
    font-weight: 600;
}
table.diff .diff_next {
    background-color: #f1f5f9;
    text-align: center;
}
table.diff td.diff_add {
    background-color: #ecfdf5;
    color: #065f46;
    font-weight: 600;
}
table.diff td.diff_chg {
    background-color: #eff6ff;
    color: #1e40af;
    font-weight: 600;
}
table.diff td.diff_sub {
    background-color: #fff1f2;
    color: #9f1239;
    font-weight: 600;
}

/* Touch & Mobile Utilities */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Code blocks & Pre styling */
.prose-legal pre {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.85rem;
    overflow-x: auto;
    max-width: 100%;
    margin: 0.85rem 0;
    color: #082749;
    font-weight: 600;
}
.prose-legal code {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.825rem;
    color: #03569f;
    background: #e0effe;
    border: 1px solid #bae0fd;
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    font-weight: 600;
}
/* Shared brand icon. Replace static/icons/inmibot-logo.svg to update it everywhere. */
.inmibot-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: url("../icons/inmibot-logo.svg") center / contain no-repeat;
    mask: url("../icons/inmibot-logo.svg") center / contain no-repeat;
}
