/* ─── WiserFlow Design System ─────────────────────────────── */

/* ─── Custom DaisyUI Themes (oklch format) ────────────────── */

[data-theme="wiserflow"] {
    color-scheme: light;
    --p: 62.8% 0.218 264.1;       /* primary: #3B82F6 */
    --pc: 100% 0 0;               /* primary-content: white */
    --s: 69.6% 0.175 163.4;       /* secondary: #10B981 */
    --sc: 100% 0 0;               /* secondary-content: white */
    --a: 54.1% 0.235 293.5;       /* accent: #8B5CF6 */
    --ac: 100% 0 0;               /* accent-content: white */
    --n: 22.4% 0.028 264.7;       /* neutral: #1E293B */
    --nc: 96.7% 0.007 247.4;      /* neutral-content: light */
    --b1: 96.7% 0.007 247.4;      /* base-100: #F1F5F9 */
    --b2: 93.9% 0.010 249.6;      /* base-200: #E2E8F0 */
    --b3: 86.9% 0.015 252.9;      /* base-300: #CBD5E1 */
    --bc: 13.5% 0.032 265.8;      /* base-content: #0F172A */
    --in: 62.8% 0.218 264.1;      /* info: blue */
    --inc: 100% 0 0;
    --su: 69.6% 0.175 163.4;      /* success: green */
    --suc: 100% 0 0;
    --wa: 79.5% 0.175 73.0;       /* warning: amber */
    --wac: 0% 0 0;
    --er: 63.7% 0.228 29.2;       /* error: red */
    --erc: 100% 0 0;
    --rounded-box: 0.75rem;
    --rounded-btn: 0.5rem;
    --rounded-badge: 1.9rem;
    --animation-btn: 0.25s;
    --animation-input: .2s;
    --btn-focus-scale: 0.95;
    --border-btn: 1px;
    --tab-border: 1px;
    --tab-radius: 0.5rem;
}

[data-theme="wiserflow-dark"] {
    color-scheme: dark;
    --p: 72.2% 0.168 259.5;       /* primary: #60A5FA */
    --pc: 13.5% 0.032 265.8;      /* primary-content: dark */
    --s: 77.6% 0.162 163.8;       /* secondary: #34D399 */
    --sc: 13.5% 0.032 265.8;
    --a: 64.9% 0.179 292.0;       /* accent: #A78BFA */
    --ac: 13.5% 0.032 265.8;
    --n: 32.5% 0.024 264.5;       /* neutral: #334155 */
    --nc: 96.7% 0.007 247.4;
    --b1: 13.5% 0.032 265.8;      /* base-100: #0F172A */
    --b2: 22.4% 0.028 264.7;      /* base-200: #1E293B */
    --b3: 32.5% 0.024 264.5;      /* base-300: #334155 */
    --bc: 96.7% 0.007 247.4;      /* base-content: #F1F5F9 */
    --in: 72.2% 0.168 259.5;
    --inc: 13.5% 0.032 265.8;
    --su: 77.6% 0.162 163.8;
    --suc: 13.5% 0.032 265.8;
    --wa: 83.9% 0.17 84.5;        /* warning: amber */
    --wac: 13.5% 0.032 265.8;
    --er: 68.4% 0.184 24.6;       /* error: red */
    --erc: 13.5% 0.032 265.8;
    --rounded-box: 0.75rem;
    --rounded-btn: 0.5rem;
    --rounded-badge: 1.9rem;
    --animation-btn: 0.25s;
    --animation-input: .2s;
    --btn-focus-scale: 0.95;
    --border-btn: 1px;
    --tab-border: 1px;
    --tab-radius: 0.5rem;
}

/* ─── WhatsApp Chat Background ─────────────────────────────── */
[data-theme="wiserflow"] {
    --wa-chat-bg: #E5DDD5;           /* warm beige like WhatsApp light */
    --wa-chat-pattern-opacity: 0.06;
}
[data-theme="wiserflow-dark"] {
    --wa-chat-bg: #0B141A;           /* dark teal-black like WhatsApp dark */
    --wa-chat-pattern-opacity: 0.03;
}

/* ─── Avatar Colors ───────────────────────────────────────── */

.avatar-blue { background-color: #3B82F6; }
.avatar-emerald { background-color: #10B981; }
.avatar-violet { background-color: #8B5CF6; }
.avatar-amber { background-color: #F59E0B; }
.avatar-rose { background-color: #F43F5E; }
.avatar-cyan { background-color: #06B6D4; }
.avatar-orange { background-color: #F97316; }
.avatar-indigo { background-color: #6366F1; }

:root {
    --wf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --wf-radius-sm: 0.375rem;
    --wf-radius-md: 0.5rem;
    --wf-radius-lg: 0.75rem;
    --wf-radius-xl: 1rem;
    --wf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --wf-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --wf-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --wf-sidebar-width: 3.5rem;
    --wf-sidebar-expanded: 15rem;
    --wf-topbar-height: 3.5rem;
}

html, body {
    font-family: var(--wf-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Skeleton Loader ──────────────────────────────────────── */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        oklch(var(--b3)) 25%,
        oklch(var(--b2)) 50%,
        oklch(var(--b3)) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--wf-radius-sm);
}

.skeleton-text {
    height: 0.875rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-circle {
    border-radius: 50%;
}

/* ─── Slide Over Panel ─────────────────────────────────────── */

.slide-over-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgb(0 0 0 / 0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity var(--wf-transition);
    pointer-events: none;
}

.slide-over-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.slide-over {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    width: 100%;
    max-width: 30rem;
    transform: translateX(100%);
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.slide-over.open {
    transform: translateX(0);
}

/* ─── Hover Row ────────────────────────────────────────────── */

.hover-row {
    transition: background-color var(--wf-transition);
    cursor: pointer;
}

.hover-row:hover {
    background-color: oklch(var(--b2) / 0.5);
}

/* ─── Status Dots ──────────────────────────────────────────── */

.ticket-list-row {
    transition: background-color var(--wf-transition), box-shadow 220ms ease, transform 220ms ease;
}

.ticket-panels-shell {
    width: 100%;
}

.ticket-panels-shell.is-collapsed {
    display: none;
}

@media (min-width: 1280px) {
    .ticket-panels-shell {
        width: 20rem;
        flex-shrink: 0;
    }
}

.ticket-panels-card {
    position: sticky;
    top: 1rem;
}

.ticket-panels-card button.w-full.text-left.rounded-xl:focus,
.ticket-panels-card button.w-full.text-left.rounded-xl:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.ticket-panels-card button.w-full.text-left.rounded-xl[class*="bg-base-200"] {
    border-color: transparent !important;
    box-shadow: inset 0 0 0 1px oklch(var(--b3) / 0.8);
}


.ticket-view-modal {
    width: min(98vw, 1720px);
    max-width: min(98vw, 1720px);
    height: min(96vh, 1120px);
    max-height: min(96vh, 1120px);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
}

.ticket-view-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.35rem;
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

@media (min-width: 1500px) {
    .ticket-view-modal-body {
        grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.95fr);
        align-items: start;
    }
}

.ticket-view-modal-main,
.ticket-view-modal-side {
    min-width: 0;
}

.ticket-view-modal-side {
    align-self: start;
}

.ticket-view-modal-side > * {
    width: 100%;
}

.ticket-view-section {
    background: oklch(var(--b1) / 0.5);
}

.ticket-condition-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .ticket-condition-row {
        grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 0.95fr) minmax(220px, 1.3fr) auto;
    }
}

.ticket-column-list {
    max-height: 28rem;
    overflow: auto;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-column-dropzone {
    min-height: 16rem;
    padding: 0.25rem;
    border-radius: 0.9rem;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.ticket-column-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    cursor: grab;
    user-select: none;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.ticket-column-item:active {
    cursor: grabbing;
}

.ticket-column-item:hover {
    transform: translateY(-1px);
}

.ticket-column-item-available {
    background: oklch(var(--b2) / 0.65);
    border: 1px solid oklch(var(--b3) / 0.9);
}

.ticket-column-item-selected {
    background: oklch(var(--p) / 0.1);
    border: 1px solid oklch(var(--p) / 0.18);
    flex-direction: column;
    align-items: stretch;
}

.ticket-column-grip {
    font-family: monospace;
    letter-spacing: 0.08em;
    font-size: 1rem;
    line-height: 1;
    color: oklch(var(--bc) / 0.45);
}

.ticket-view-modal-side .grid.grid-cols-1.\32 xl\:grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1200px) {
    .ticket-view-modal-side .grid.grid-cols-1.\32 xl\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ticket-list-row-new {
    background: linear-gradient(90deg, oklch(var(--p) / 0.16), transparent 68%);
    box-shadow: inset 3px 0 0 oklch(var(--p));
    animation: ticket-row-new-flash 4.8s ease-out forwards;
}

@keyframes ticket-row-new-flash {
    0% {
        background: linear-gradient(90deg, oklch(var(--p) / 0.24), transparent 72%);
        transform: translateX(0);
    }
    18% {
        background: linear-gradient(90deg, oklch(var(--p) / 0.18), transparent 72%);
        transform: translateX(2px);
    }
    100% {
        background: transparent;
        transform: translateX(0);
    }
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-open { background-color: #22C55E; }
.status-dot-in-progress { background-color: #3B82F6; }
.status-dot-waiting { background-color: #F59E0B; }
.status-dot-forwarded-dev { background-color: #8B5CF6; }
.status-dot-resolved { background-color: #6B7280; }
.status-dot-closed { background-color: #9CA3AF; }

/* ─── Priority Badges ─────────────────────────────────────── */

.priority-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    line-height: 1.25rem;
}

.priority-critical { background-color: #FEE2E2; color: #991B1B; }
.priority-high { background-color: #FFEDD5; color: #9A3412; }
.priority-medium { background-color: #FEF9C3; color: #854D0E; }
.priority-low { background-color: #F1F5F9; color: #475569; }

/* Dark mode priority adjustments */
[data-theme="wiserflow-dark"] .priority-critical { background-color: #450A0A; color: #FCA5A5; }
[data-theme="wiserflow-dark"] .priority-high { background-color: #431407; color: #FDBA74; }
[data-theme="wiserflow-dark"] .priority-medium { background-color: #422006; color: #FDE047; }
[data-theme="wiserflow-dark"] .priority-low { background-color: #1E293B; color: #94A3B8; }

/* ─── Avatar ───────────────────────────────────────────────── */

.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
}

.avatar-initials-sm {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
}

.avatar-initials-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

/* ─── Custom Scrollbar ─────────────────────────────────────── */

.wf-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.wf-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.wf-scrollbar::-webkit-scrollbar-thumb {
    background-color: oklch(var(--bc) / 0.15);
    border-radius: 3px;
}

.wf-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: oklch(var(--bc) / 0.25);
}

/* ─── Sidebar ──────────────────────────────────────────────── */

.wf-sidebar {
    width: var(--wf-sidebar-width);
    transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow: hidden;
}

.wf-sidebar.expanded {
    width: var(--wf-sidebar-expanded);
}

.wf-sidebar .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 150ms, width 200ms;
}

.wf-sidebar.expanded .nav-label {
    opacity: 1;
    width: auto;
}

.wf-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--wf-radius-md);
    color: oklch(var(--bc) / 0.65);
    transition: all var(--wf-transition);
    position: relative;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 2.25rem;
}

.wf-nav-item:hover {
    background-color: oklch(var(--b2));
    color: oklch(var(--bc));
}

.wf-nav-item.active {
    background-color: oklch(var(--p) / 0.1);
    color: oklch(var(--p));
}

.wf-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 2px;
    background-color: oklch(var(--p));
    border-radius: 1px;
}

/* ─── Topbar ───────────────────────────────────────────────── */

.wf-topbar {
    height: var(--wf-topbar-height);
    border-bottom: 1px solid oklch(var(--b3));
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ─── Tab Bar ──────────────────────────────────────────────── */

.wf-tab-bar {
    position: relative;
    display: flex;
    align-items: stretch;
    background: oklch(var(--b2));
    border-bottom: 1px solid oklch(var(--b3));
    flex-shrink: 0;
    min-height: 2.25rem;
    max-height: 2.25rem;
    user-select: none;
}

.wf-tab-bar-scroll {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wf-tab-bar-scroll::-webkit-scrollbar {
    display: none;
}

.wf-tab {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.75rem;
    min-width: 0;
    max-width: 12rem;
    height: 100%;
    font-size: 0.75rem;
    color: oklch(var(--bc) / 0.6);
    border-right: 1px solid oklch(var(--b3) / 0.5);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
}

.wf-tab:hover {
    background: oklch(var(--b1));
    color: oklch(var(--bc) / 0.85);
}

.wf-tab.active {
    background: oklch(var(--b1));
    color: oklch(var(--bc));
    font-weight: 500;
}

.wf-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: oklch(var(--p));
}

.wf-tab-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.wf-tab.active .wf-tab-icon {
    opacity: 1;
    color: oklch(var(--p));
}

.wf-tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wf-tab-dirty {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: oklch(var(--wa));
    flex-shrink: 0;
}

.wf-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 0.25rem;
    flex-shrink: 0;
    opacity: 0;
    color: oklch(var(--bc) / 0.5);
    transition: opacity 100ms ease, background-color 100ms ease, color 100ms ease;
    margin-left: auto;
}

.wf-tab:hover .wf-tab-close,
.wf-tab.active .wf-tab-close {
    opacity: 1;
}

.wf-tab-close:hover {
    background: oklch(var(--er) / 0.15);
    color: oklch(var(--er));
}

/* Tab + button (inline after last tab) */
.wf-tab-add-wrapper {
    display: flex;
    align-items: center;
    padding: 0 0.375rem;
    flex-shrink: 0;
}

.wf-tab-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    color: oklch(var(--bc) / 0.5);
    transition: background-color 120ms ease, color 120ms ease;
    cursor: pointer;
}

.wf-tab-add-btn:hover {
    background: oklch(var(--b1));
    color: oklch(var(--p));
}

/* Pinned tabs */
.wf-tab.pinned {
    border-left: 2px solid oklch(var(--p) / 0.5);
}

.wf-tab.pinned .wf-tab-close {
    display: none;
}

/* Drag and drop */
.wf-tab.dragging {
    opacity: 0.4;
}

.wf-tab.drop-target {
    border-left: 2px solid oklch(var(--p));
}

/* Tab context menu */
.wf-tab-context-menu {
    position: fixed;
    z-index: 51;
    background: oklch(var(--b1));
    border: 1px solid oklch(var(--b3));
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
    padding: 0.25rem;
    min-width: 10rem;
}

.wf-tab-context-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: oklch(var(--bc));
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 100ms ease;
}

.wf-tab-context-menu button:hover {
    background: oklch(var(--b2));
}

/* ─── Page Header ──────────────────────────────────────────── */

.wf-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.wf-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: oklch(var(--bc));
    line-height: 1.2;
    outline: none;
    border: none;
    user-select: none;
    -webkit-user-select: none;
}

.wf-page-title:focus,
.wf-page-title:focus-visible,
.wf-page-title-static,
.wf-page-title-static:focus,
.wf-page-title-static:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.btn.btn-ghost.btn-xs.btn-square.text-error[aria-label^="Excluir"] {
    width: 2.125rem;
    height: 2.125rem;
    min-height: 2.125rem;
    padding: 0.2rem;
}

.btn.btn-ghost.btn-xs.btn-square.text-error[aria-label^="Excluir"] svg {
    width: 1.1rem !important;
    height: 1.1rem !important;
    stroke-width: 2 !important;
}

/* ─── Cards ────────────────────────────────────────────────── */

.wf-card {
    border: 1px solid oklch(var(--b3));
    border-radius: var(--wf-radius-lg);
    background-color: oklch(var(--b1));
    overflow: hidden;
}

.wf-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid oklch(var(--b3));
    font-size: 0.875rem;
    font-weight: 600;
}

.wf-card-body {
    padding: 1.25rem;
}

/* ─── Tables ───────────────────────────────────────────────── */

.wf-table {
    width: 100%;
    border-collapse: collapse;
}

.wf-table thead th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: oklch(var(--bc) / 0.5);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid oklch(var(--b3));
}

.wf-table tbody tr {
    border-bottom: 1px solid oklch(var(--b2));
    transition: background-color var(--wf-transition);
}

.wf-table tbody tr:hover {
    background-color: oklch(var(--b2) / 0.5);
}

.wf-table tbody td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.customer-list-table {
    min-width: 980px;
}

.customer-list-table .company-column {
    min-width: 16rem;
    width: 16rem;
    white-space: normal;
    word-break: break-word;
}

/* ─── Empty State ──────────────────────────────────────────── */

.wf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.wf-empty-state svg {
    width: 3rem;
    height: 3rem;
    color: oklch(var(--bc) / 0.25);
    margin-bottom: 1rem;
}

.wf-empty-state h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: oklch(var(--bc) / 0.7);
    margin-bottom: 0.25rem;
}

.wf-empty-state p {
    font-size: 0.8125rem;
    color: oklch(var(--bc) / 0.5);
    margin-bottom: 1rem;
}

/* ─── Internal Note Highlight ──────────────────────────────── */

.internal-note {
    background-color: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--wf-radius-md);
}

.ticket-message {
    position: relative;
}

.ticket-message-actions {
    opacity: 0;
    pointer-events: none;
    flex-shrink: 0;
    transition: opacity var(--wf-transition);
}

.ticket-message:hover .ticket-message-actions,
.ticket-message:focus-within .ticket-message-actions,
.ticket-message-actions:focus-within {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="wiserflow-dark"] .internal-note {
    background-color: #422006;
    border-color: #92400E;
}

/* ─── Tooltip (for collapsed sidebar) ──────────────────────── */

.wf-tooltip {
    position: relative;
}

.wf-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 0.75rem);
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem 0.625rem;
    border-radius: var(--wf-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    background-color: oklch(var(--n));
    color: oklch(var(--nc, var(--b1)));
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--wf-transition);
    z-index: 50;
}

.wf-tooltip:hover::after {
    opacity: 1;
}

.wf-sidebar.expanded .wf-tooltip::after {
    display: none;
}

/* ─── Form Validation ──────────────────────────────────────── */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #EF4444;
}

.validation-message {
    color: #EF4444;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ─── Blazor Infrastructure ────────────────────────────────── */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #3B82F6;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ─── Accessibility ────────────────────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus,
.focus\:not-sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

*:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── Responsive: Mobile sidebar overlay ───────────────────── */

@media (max-width: 1023px) {
    .wf-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgb(0 0 0 / 0.4);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--wf-transition);
    }

    .wf-sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .wf-sidebar-mobile {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 40;
        width: var(--wf-sidebar-expanded);
        transform: translateX(-100%);
        transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .wf-sidebar-mobile.open {
        transform: translateX(0);
    }
}

/* ─── Quill Editor Overrides ────────────────────────────── */

#quill-editor .ql-editor,
.ql-editor {
    min-height: 60px;
    max-height: 200px;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
}

.ql-editor p {
    margin: 0.25rem 0;
}

.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid oklch(var(--b3)) !important;
    padding: 4px 8px !important;
}

.ql-container.ql-snow {
    border: none !important;
}

.ql-editor.ql-blank::before {
    font-style: normal !important;
    color: oklch(var(--bc) / 0.35) !important;
}

/* ─── Prose (message & article HTML rendering) ──────────── */

.prose {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: oklch(var(--bc) / 0.9);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

/* ─── Headings ─── */

.prose h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid oklch(var(--p) / 0.3);
    color: oklch(var(--bc));
    line-height: 1.3;
}

.prose h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid oklch(var(--b3));
    color: oklch(var(--bc));
    line-height: 1.35;
}

.prose h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: oklch(var(--bc));
    line-height: 1.4;
}

.prose h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: oklch(var(--bc) / 0.9);
}

.prose h5, .prose h6 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: oklch(var(--bc) / 0.8);
}

/* ─── Paragraphs & text ─── */

.prose p {
    margin: 0.25rem 0;
}

.prose strong {
    font-weight: 600;
    color: oklch(var(--bc));
}

.prose a {
    color: oklch(var(--p));
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    opacity: 0.8;
}

/* ─── Lists ─── */

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin: 0.75rem 0;
}

.prose li {
    margin: 0.25rem 0;
}

.prose li > ul, .prose li > ol {
    margin: 0.25rem 0;
}

/* ─── Blockquotes ─── */

.prose blockquote {
    border-left: 4px solid oklch(var(--p) / 0.4);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: oklch(var(--b2) / 0.5);
    border-radius: 0 0.375rem 0.375rem 0;
    color: oklch(var(--bc) / 0.8);
    font-style: italic;
}

.prose blockquote p {
    margin: 0.25rem 0;
}

/* ─── Code ─── */

.prose code {
    font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.8125rem;
    padding: 0.125rem 0.375rem;
    background: oklch(var(--b3) / 0.6);
    border-radius: 0.25rem;
    color: oklch(var(--p));
}

.prose pre {
    margin: 1rem 0;
    padding: 1rem;
    background: oklch(var(--b2));
    border: 1px solid oklch(var(--b3));
    border-radius: 0.5rem;
    overflow-x: auto;
    line-height: 1.6;
}

.prose pre code {
    padding: 0;
    background: none;
    border-radius: 0;
    color: oklch(var(--bc) / 0.85);
    font-size: 0.8125rem;
}

/* ─── Tables ─── */

.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.875rem;
    border: 1px solid oklch(var(--b3));
    border-radius: 0.5rem;
    overflow: hidden;
}

.prose thead {
    background: oklch(var(--b2));
}

.prose th {
    font-weight: 600;
    text-align: left;
    padding: 0.625rem 0.75rem;
    border: 1px solid oklch(var(--b3));
    color: oklch(var(--bc) / 0.8);
    font-size: 0.8125rem;
}

.prose td {
    padding: 0.5rem 0.75rem;
    border: 1px solid oklch(var(--b3));
    vertical-align: top;
}

.prose tbody tr:nth-child(even) {
    background: oklch(var(--b2) / 0.3);
}

.prose tbody tr:hover {
    background: oklch(var(--b2) / 0.6);
}

/* ─── Horizontal Rules ─── */

.prose hr {
    border: none;
    border-top: 1px solid oklch(var(--b3));
    margin: 2rem 0;
}

/* ─── Definition Lists ─── */

.prose dl {
    margin: 0.75rem 0;
}

.prose dt {
    font-weight: 600;
    margin-top: 0.75rem;
}

.prose dd {
    margin-left: 1.5rem;
    color: oklch(var(--bc) / 0.8);
}

/* ─── First heading in article (remove top margin) ─── */

.prose > h1:first-child,
.prose > h2:first-child,
.prose > h3:first-child {
    margin-top: 0;
}

/* ─── Print Styles ──────────────────────────────────────── */

@media print {
    /* Hide navigation, sidebar, composer, buttons */
    nav, .wf-sidebar, .wf-sidebar-mobile,
    .border-t.border-base-300, /* composer */
    .sticky.top-0 button, /* header buttons */
    .btn, select, input, .checkbox,
    .ql-toolbar, #quill-editor,
    .internal-note .text-warning,
    footer {
        display: none !important;
    }

    /* Full width for conversation */
    .grid.grid-cols-1.lg\:grid-cols-3 {
        display: block !important;
    }

    .lg\:col-span-2 {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Show content cleanly */
    body, .bg-base-100 {
        background: white !important;
        color: black !important;
    }

    .wf-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .max-h-\[55vh\] {
        max-height: none !important;
        overflow: visible !important;
    }

    .sticky {
        position: static !important;
    }

    /* Quote print styles */
    .wf-quote-tabs,
    .wf-quote-toolbar,
    .wf-quote-actions,
    .quote-section-drag-handle,
    .quote-item-drag-handle,
    .tabs,
    .fixed.bottom-0,
    .modal {
        display: none !important;
    }

    .wf-quote-section-body {
        display: block !important;
    }

    .wf-quote-tab-content {
        display: block !important;
    }

    .wf-quote-section {
        break-inside: avoid;
        margin-bottom: 1rem;
    }

    .wf-quote-totals {
        break-inside: avoid;
        border-top: 2px solid #333;
        margin-top: 1rem;
        padding-top: 0.5rem;
    }
}

/* ─── Frappe Gantt Overrides ──────────────────────────────── */

.gantt-container {
    overflow-x: auto;
    border: 1px solid oklch(var(--b3));
    border-radius: 0.5rem;
    background: oklch(var(--b1));
}

.gantt .bar-wrapper .bar {
    rx: 4;
    ry: 4;
}

.gantt .grid-header {
    fill: oklch(var(--b2));
}

.gantt .grid-row {
    fill: oklch(var(--b1));
}

.gantt .grid-row:nth-child(even) {
    fill: oklch(var(--b2) / 0.3);
}

.gantt .row-line {
    stroke: oklch(var(--b3));
}

.gantt .tick {
    stroke: oklch(var(--b3) / 0.5);
}

.gantt .today-highlight {
    fill: oklch(var(--p) / 0.08);
}

.gantt .lower-text, .gantt .upper-text {
    fill: oklch(var(--bc) / 0.6);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
}

.gantt .bar-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
}

.gantt .bar-wrapper:hover .bar {
    filter: brightness(0.92);
}

.gantt .bar-wrapper .bar-progress {
    fill: oklch(var(--p) / 0.4);
}

.gantt .handle-group .handle {
    fill: oklch(var(--p));
    cursor: ew-resize;
}

.gantt .handle-group .handle.progress {
    fill: oklch(var(--su));
}

/* Status-based bar colors */
.gantt .gantt-not-started .bar {
    fill: oklch(var(--bc) / 0.15);
}
.gantt .gantt-not-started .bar-progress {
    fill: oklch(var(--bc) / 0.25);
}

.gantt .gantt-in-progress .bar {
    fill: oklch(var(--in));
}
.gantt .gantt-in-progress .bar-progress {
    fill: oklch(var(--in) / 0.6);
}

.gantt .gantt-on-hold .bar {
    fill: oklch(var(--wa));
}
.gantt .gantt-on-hold .bar-progress {
    fill: oklch(var(--wa) / 0.6);
}

.gantt .gantt-completed .bar {
    fill: oklch(var(--su));
}
.gantt .gantt-completed .bar-progress {
    fill: oklch(var(--su) / 0.6);
}

.gantt .gantt-not-applicable .bar {
    fill: oklch(var(--bc) / 0.08);
}

/* Dependency arrows */
.gantt .arrow {
    stroke: oklch(var(--p) / 0.5);
    stroke-width: 1.5;
    fill: oklch(var(--p) / 0.5);
}

/* Popup */
.gantt .popup-wrapper {
    z-index: 50;
}

.gantt .popup-wrapper .pointer {
    display: none;
}

.gantt .popup-wrapper .title {
    display: none;
}

.gantt .popup-wrapper .popup {
    background: oklch(var(--b1));
    border: 1px solid oklch(var(--b3));
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    color: oklch(var(--bc));
    padding: 0;
}

/* Dark theme adjustments */
[data-theme="wiserflow-dark"] .gantt .bar-label {
    fill: oklch(var(--bc)) !important;
}

[data-theme="wiserflow-dark"] .gantt .popup-wrapper .popup {
    background: oklch(var(--b2));
}

/* Frappe Gantt SVG background override */
.gantt svg {
    background: transparent !important;
}

[data-theme="wiserflow-dark"] .gantt .grid-header {
    fill: oklch(var(--b2));
}

[data-theme="wiserflow-dark"] .gantt .grid-row {
    fill: oklch(var(--b1));
}

[data-theme="wiserflow-dark"] .gantt .grid-row:nth-child(even) {
    fill: oklch(var(--b2) / 0.2);
}

[data-theme="wiserflow-dark"] .gantt .row-line {
    stroke: oklch(var(--bc) / 0.1);
}

[data-theme="wiserflow-dark"] .gantt .tick {
    stroke: oklch(var(--bc) / 0.08);
}

[data-theme="wiserflow-dark"] .gantt .lower-text,
[data-theme="wiserflow-dark"] .gantt .upper-text {
    fill: oklch(var(--bc) / 0.7);
}

[data-theme="wiserflow-dark"] .gantt .today-highlight {
    fill: oklch(var(--p) / 0.12);
}

[data-theme="wiserflow-dark"] .gantt .arrow {
    stroke: oklch(var(--p) / 0.6);
    fill: oklch(var(--p) / 0.6);
}

[data-theme="wiserflow-dark"] .gantt .handle-group .handle {
    fill: oklch(var(--p) / 0.8);
}

/* ─── FullCalendar Overrides ──────────────────────────────── */

.fc {
    font-family: 'Inter', sans-serif;
    --fc-border-color: oklch(var(--b3));
    --fc-page-bg-color: oklch(var(--b1));
    --fc-neutral-bg-color: oklch(var(--b2));
    --fc-today-bg-color: oklch(var(--p) / 0.05);
    --fc-event-border-color: transparent;
    --fc-now-indicator-color: oklch(var(--er));
    --fc-button-bg-color: oklch(var(--b2));
    --fc-button-border-color: oklch(var(--b3));
    --fc-button-text-color: oklch(var(--bc));
    --fc-button-hover-bg-color: oklch(var(--b3));
    --fc-button-hover-border-color: oklch(var(--b3));
    --fc-button-active-bg-color: oklch(var(--p));
    --fc-button-active-border-color: oklch(var(--p));
    --fc-button-active-text-color: oklch(var(--pc));
}

.fc .fc-button {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.fc .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: oklch(var(--bc));
}

.fc .fc-col-header-cell-cushion {
    color: oklch(var(--bc) / 0.7);
    font-weight: 500;
    font-size: 0.8rem;
}

.fc .fc-timegrid-slot-label-cushion {
    font-size: 0.75rem;
    color: oklch(var(--bc) / 0.5);
}

.fc .fc-event {
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 1px 4px;
    cursor: pointer;
}

.fc .fc-event:hover {
    filter: brightness(0.9);
}

.fc .fc-event .fc-event-title {
    font-weight: 500;
}

.fc .fc-daygrid-event-dot {
    border-color: inherit;
}

.fc .fc-list-event:hover td {
    background-color: oklch(var(--b2));
}

.fc .fc-list-day-cushion {
    background-color: oklch(var(--b2));
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: oklch(var(--b3));
}

.fc .fc-scrollgrid {
    border-color: oklch(var(--b3));
}

/* WhatsApp compacted conversation styles */
.wf-whatsapp-session { display: flex; flex-direction: column; gap: 0.5rem; }
.wf-chat-message { padding: 0.5rem 0.75rem; border-radius: 0.5rem; max-width: 80%; }
.wf-chat-customer { background-color: #f3f4f6; align-self: flex-start; }
.wf-chat-agent { background-color: #dcfce7; align-self: flex-end; }
.wf-chat-sender { font-weight: 600; font-size: 0.75rem; color: #374151; }
.wf-chat-time { font-size: 0.625rem; color: #9ca3af; margin-left: 0.5rem; }
.wf-chat-message p { margin: 0.25rem 0 0; font-size: 0.875rem; }
.wf-chat-attachment { font-size: 0.75rem; color: #6b7280; }
.wf-chat-attachment a { color: #2563eb; text-decoration: underline; }

/* Project drag and drop feedback */
.wf-sortable-ghost {
    opacity: 0.35 !important;
    background: oklch(var(--p) / 0.08) !important;
}

.wf-sortable-chosen {
    box-shadow: 0 0 0 1px oklch(var(--p) / 0.35), 0 18px 35px -24px oklch(var(--p) / 0.65);
}

.wf-sortable-drag {
    opacity: 0.98 !important;
    transform: rotate(0.5deg) scale(1.01);
}

.project-stage-card {
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.project-stage-card.wf-drop-before {
    box-shadow: inset 0 3px 0 oklch(var(--p));
}

.project-stage-card.wf-drop-after {
    box-shadow: inset 0 -3px 0 oklch(var(--p));
}

.project-stage-card.wf-task-dropzone-active {
    border-color: oklch(var(--p) / 0.45);
    background-image: linear-gradient(180deg, oklch(var(--p) / 0.05), transparent 28%);
}

.project-task-row > td {
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.project-task-row.wf-drop-before > td {
    border-top: 2px solid oklch(var(--p));
    background-color: oklch(var(--p) / 0.08);
}

.project-task-row.wf-drop-after > td {
    border-bottom: 2px solid oklch(var(--p));
    background-color: oklch(var(--p) / 0.08);
}

.stage-drag-handle,
.task-drag-handle {
    touch-action: none;
    user-select: none;
}

/* Mention styling */
.wf-mention {
    color: #1E5FA8;
    font-weight: 600;
}

/* Customer portal — message bubble HTML reset.
   Quill ships rich-text content with <p>, <ol>, <ul>, <a> wrappers and we
   render it inside colored chat bubbles. Tailwind Typography (`prose`) was
   adding huge top/bottom margins on every paragraph and forcing its own
   color, which broke the layout (text wrapping weird, list markers far
   from items, contrast killed inside the primary bubble). This minimal
   reset keeps the bubble's text color, removes the chunky margins, and
   only restores the bits we actually want. */
.wf-portal-message { line-height: 1.5; }
.wf-portal-message p { margin: 0 0 0.5em 0; }
.wf-portal-message p:last-child { margin-bottom: 0; }
.wf-portal-message ol,
.wf-portal-message ul { margin: 0.25em 0 0.5em 1.25em; padding: 0; }
.wf-portal-message ol { list-style: decimal; }
.wf-portal-message ul { list-style: disc; }
.wf-portal-message li { margin: 0.15em 0; }
.wf-portal-message a { text-decoration: underline; color: inherit; }
.wf-portal-message strong { font-weight: 600; }
.wf-portal-message em { font-style: italic; }
.wf-portal-message img { max-width: 100%; height: auto; border-radius: 6px; margin: 0.25em 0; }
.wf-portal-message pre,
.wf-portal-message code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
.wf-portal-message pre { padding: 0.6em 0.9em; overflow-x: auto; }
