﻿        body { 
            font-family: 'Inter', system-ui, sans-serif; 
            background: #f8fafc;
        }

        /* Flex shell: content pane must shrink so overflow-y-auto can scroll */
        #main-app > main {
            min-height: 0;
        }
        #main-app > main > #app-content,
        #main-app > main > #expiry-view {
            min-height: 0;
            -webkit-overflow-scrolling: touch;
        }

        /* Shared pop-outs: never taller than the screen; scroll to Close */
        #modal-backdrop {
            align-items: flex-start !important;
            justify-content: center !important;
            overflow-x: hidden !important;
            overflow-y: auto !important;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            padding: 0.75rem !important;
        }
        #modal-content {
            margin-top: auto;
            margin-bottom: auto;
            max-height: calc(100dvh - 1.5rem);
            min-height: 0;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        #modal-content [data-modal-scroll-body] {
            min-height: 0;
            overscroll-behavior: contain;
        }

        /* Custom full-screen overlays (PIN gates, extra dialogs) — not the login shell */
        .fixed.inset-0.flex.items-center.justify-center:not(#login-view) {
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            align-items: flex-start;
        }
        .fixed.inset-0.flex.items-center.justify-center:not(#login-view) > .modern-card,
        .fixed.inset-0.flex.items-center.justify-center:not(#login-view) > .bg-white,
        .fixed.inset-0.flex.items-center.justify-center:not(#login-view) > [class*="rounded-2xl"] {
            margin-top: auto;
            margin-bottom: auto;
            max-height: calc(100dvh - 1.5rem);
            overflow-y: auto;
            overscroll-behavior: contain;
        }

        @media print {
            body * { visibility: hidden; }
            #modal-content, #print-area, #print-area * { visibility: visible; }
            #modal-content { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: none; }
        }

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

        /* Sidebar â€” keep footer pinned; nav scrolls so last items (e.g. Clinical & Data) stay reachable */
        #sidebar {
            background: #0f172a;
            box-shadow: 4px 0 20px -4px rgb(0 0 0 / 0.15);
            transition: transform 0.3s ease-in-out, margin-left 0.3s ease-in-out;
            height: 100%;
            max-height: 100dvh;
            overflow: hidden;
        }
        #sidebar-nav {
            min-height: 0;
            flex: 1 1 auto;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 0.75rem;
        }
        @media (min-width: 768px) {
            #sidebar.collapsed { margin-left: -16rem; }
        }

        /* Header Glassmorphism */
        header {
            background: rgba(255, 255, 255, 0.85) !important;
            backdrop-filter: blur(12px);
            border-bottom: 1px solid #e2e8f0;
        }

        /* Buttons */
        .btn-modern {
            border-radius: 9999px;
            font-weight: 600;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .btn-modern:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
        }

        /* =========================================
           NEW INDUSTRIAL AGGRESSIVE STYLING
           ========================================= */
           
        /* Cards - Sharper, Enterprise Look */
        :where(.modern-card) {
            background: white;
            border-radius: 6px; /* Sharper corners, less playful */
            border: 1px solid #cbd5e1; /* Stronger borders */
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); /* Tighter, harder shadow */
            transition: all 0.2s ease;
        }
        :where(.modern-card):hover {
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
            transform: translateY(-2px);
        }

        /* Traffic Light - Industrial & High Visibility */
        .traffic-box {
            background: #0f172a; /* Dark console background */
            border: 2px solid #1e293b;
            border-radius: 6px; /* Boxy industrial look */
            padding: 6px 12px;
            display: inline-flex; 
            gap: 12px;
            align-items: center;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.1);
        }
        .led { 
            width: 14px; /* Much larger */
            height: 14px; 
            border-radius: 50%; 
            opacity: 0.15; /* Very dark when off */
            transition: all 0.2s ease; 
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
        }
        /* Intense Glow Effects for active status */
        .led.red.active { background: #ff2a2a; opacity: 1; box-shadow: 0 0 12px #ff2a2a, inset 0 0 5px rgba(255,255,255,0.8); border-color: #ff2a2a; transform: scale(1.1); }
        .led.yellow.active { background: #ffcc00; opacity: 1; box-shadow: 0 0 12px #ffcc00, inset 0 0 5px rgba(255,255,255,0.8); border-color: #ffcc00; transform: scale(1.1); }
        .led.green.active { background: #00ff44; opacity: 1; box-shadow: 0 0 12px #00ff44, inset 0 0 5px rgba(255,255,255,0.8); border-color: #00ff44; transform: scale(1.1); }

/* Giant Traffic Light for Dashboard Header */
        .traffic-box-large {
            background: #0f172a; 
            border: 3px solid #1e293b;
            border-radius: 12px; 
            padding: 12px 24px;
            display: inline-flex; 
            gap: 20px;
            align-items: center;
            box-shadow: inset 0 4px 10px rgba(0,0,0,0.8), 0 4px 6px rgba(0,0,0,0.2);
        }
        .traffic-box-large .led { 
            width: 28px; 
            height: 28px; 
            border-radius: 50%; 
            opacity: 0.15; 
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
            border: 2px solid rgba(255,255,255,0.05);
            box-shadow: inset 0 4px 8px rgba(0,0,0,0.6);
        }
        .traffic-box-large .led.red.active { background: #ff2a2a; opacity: 1; box-shadow: 0 0 30px #ff2a2a, inset 0 0 15px rgba(255,255,255,0.9); border-color: #ff2a2a; transform: scale(1.15); }
        .traffic-box-large .led.yellow.active { background: #ffcc00; opacity: 1; box-shadow: 0 0 30px #ffcc00, inset 0 0 15px rgba(255,255,255,0.9); border-color: #ffcc00; transform: scale(1.15); }
        .traffic-box-large .led.green.active { background: #00ff44; opacity: 1; box-shadow: 0 0 30px #00ff44, inset 0 0 15px rgba(255,255,255,0.9); border-color: #00ff44; transform: scale(1.15); }

        /* Table Improvements - Heavy Data Anchor */
        table thead {
            background: #1e293b !important; /* Dark header */
            color: #f8fafc !important; /* White text */
        }
        table thead tr {
            border-bottom: none;
        }
        /* Light header for tables inside modals/sheets where dark global thead is wrong */
        table.expiry-head-light thead {
            background: #f1f5f9 !important;
            color: #334155 !important;
        }
        table.expiry-head-light thead th {
            color: #334155 !important;
        }
        th.sortable {
            position: relative;
            cursor: pointer; 
            user-select: none; 
            transition: background 0.2s;
            color: #f1f5f9 !important; /* Make sortable text white */
        }
        th.sortable:hover { background-color: #334155 !important; }

        th.nexus-sortable {
            cursor: pointer;
            user-select: none;
        }
        th.nexus-sortable .nexus-sort-ind {
            display: inline-block;
            margin-left: 0.2rem;
            opacity: 0.35;
            font-size: 0.7em;
            font-weight: 700;
        }
        th.nexus-sortable.is-sorted .nexus-sort-ind { opacity: 0.9; }

        /* =========================================
           END NEW STYLING
           ========================================= */

        /* Toast — always above modals, loading overlays, and other windows */
        #toast-container {
            position: fixed !important;
            top: max(0.75rem, env(safe-area-inset-top, 0px)) !important;
            left: 50% !important;
            right: auto !important;
            transform: translateX(-50%) !important;
            width: min(28rem, calc(100vw - 1.5rem)) !important;
            z-index: 2147483000 !important;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 0.5rem;
            pointer-events: none;
        }
        #toast-container div {
            border-radius: 12px;
            box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
            pointer-events: auto;
        }

        /* Global AI Widget */
        #global-ai-widget {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .ai-normal { bottom: 6rem; right: 1.5rem; width: 400px; max-width: calc(100vw - 2rem); height: 650px; max-height: calc(100vh - 8rem); border-radius: 20px; }
        .ai-expanded { inset: 0.5rem; width: auto; height: auto; border-radius: 16px; z-index: 60; }
        @media (min-width: 768px) {
            .ai-expanded { inset: 3rem 15%; border-radius: 20px; }
        }
        /* Notification dropdown â€” fixed layer above all page content */
        .notif-dropdown-backdrop {
            position: fixed;
            inset: 0;
            z-index: 9990;
            background: rgba(15, 23, 42, 0.18);
        }
        .notif-dropdown-panel {
            position: fixed;
            z-index: 9991;
            width: min(20rem, 92vw);
            max-width: 92vw;
            background: #ffffff !important;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
            overflow: hidden;
            cursor: default;
        }
        .notif-dropdown-panel .notif-dropdown-list,
        .notif-dropdown-panel .notif-dropdown-list > div {
            background: #ffffff;
        }
        /* Mobile notification panel â€” nearly full width when expanded */
        #notif-dropdown.notif-expanded {
            width: min(92vw, 32rem) !important;
            max-width: 92vw;
            right: 0;
            left: auto;
        }
        /* Detached notification window (pop-out) */
        #notif-popout-panel {
            position: fixed;
            z-index: 120;
            width: min(420px, 92vw);
            max-height: min(70vh, 640px);
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            top: 4.5rem;
            right: 1.5rem;
        }
        @media (max-width: 640px) {
            #notif-popout-panel {
                inset: 3.5rem 0.75rem 0.75rem 0.75rem;
                width: auto;
                max-height: none;
            }
        }
        #notif-popout-panel .notif-popout-header {
            cursor: move;
            user-select: none;
        }
        .ai-closed { transform: scale(0.9) translateY(20px); opacity: 0; pointer-events: none; }

        /* AI Markdown Content Styling */
        .ai-content p { margin-bottom: 0.75rem; }
        .ai-content p:last-child { margin-bottom: 0; }
        .ai-content ul { list-style-type: disc; margin-left: 1.5rem; margin-bottom: 0.75rem; }
        .ai-content ol { list-style-type: decimal; margin-left: 1.5rem; margin-bottom: 0.75rem; }
        .ai-content li { margin-bottom: 0.25rem; }
        .ai-content strong { color: #0f172a; font-weight: 700; }
        
        /* Typing Indicator */
        .typing-dot {
            animation: typingBounce 1.4s infinite ease-in-out both;
        }
        .typing-dot:nth-child(1) { animation-delay: -0.32s; }
        .typing-dot:nth-child(2) { animation-delay: -0.16s; }
        @keyframes typingBounce {
            0%, 80%, 100% { transform: scale(0); }
            40% { transform: scale(1); }
        }

        /* Utilities */
        .hide-scrollbar::-webkit-scrollbar { display: none; }
        .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
        
        .hide { display: none !important; }
        #mobile-overlay { transition: opacity 0.3s ease-in-out; }

        /* â”€â”€ Public form link (?form=â€¦) â€” guests never see Nexus chrome; only form on dimmed canvas â”€â”€ */
        body.public-form-mode #global-ai-btn,
        body.public-form-mode #global-ai-widget {
            display: none !important;
        }
        body.public-form-mode #main-app {
            padding-left: 0 !important;
            margin-left: 0 !important;
            min-height: 100vh;
            width: 100% !important;
            background: var(--public-form-ambient, #0f172a);
        }
        body.public-form-mode.public-form-ambient-brand #main-app {
            background: linear-gradient(160deg, #0f172a 0%, #1e3a5f 45%, #0c4a6e 100%);
        }
        body.public-form-mode #mobile-overlay,
        body.public-form-mode #sidebar {
            display: none !important;
        }
        body.public-form-mode #main-app > main {
            display: flex !important;
            flex-direction: column;
            width: 100%;
            min-height: 100vh;
            background: transparent !important;
        }
        body.public-form-mode #main-app > main > header,
        body.public-form-mode #broadcast-container {
            display: none !important;
        }
        body.public-form-mode #expiry-view {
            display: none !important;
        }
        body.public-form-mode #app-content {
            flex: 1 1 auto;
            display: flex !important;
            flex-direction: column;
            min-height: 0;
            padding: 1rem !important;
            background: transparent !important;
            align-items: center;
            justify-content: center;
        }
        #modal-backdrop.public-form-modal-backdrop {
            background: rgba(15, 23, 42, 0.82) !important;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
        }
        body.public-form-mode #modal-content {
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
        }

        /* Boot: locum invite link â€” stay on login shell until invitation HTML is ready (no main-app flash) */
        html.locum-invite-booting #main-app {
            display: none !important;
        }
        html.locum-invite-booting #login-card {
            display: none !important;
        }
        html.locum-invite-booting #login-view {
            display: flex !important;
        }
        html.locum-invite-booting #auth-loader {
            display: flex !important;
        }

        /* Public locum invitation link (?locum_invite=â€¦) */
        body.locum-invite-public-mode #global-ai-btn,
        body.locum-invite-public-mode #global-ai-widget {
            display: none !important;
        }
        body.locum-invite-public-mode #main-app {
            padding-left: 0 !important;
            margin-left: 0 !important;
            min-height: 100vh;
            width: 100% !important;
            background: #0f172a;
        }
        body.locum-invite-public-mode #mobile-overlay,
        body.locum-invite-public-mode #sidebar {
            display: none !important;
        }
        body.locum-invite-public-mode #main-app > main > header,
        body.locum-invite-public-mode #broadcast-container,
        body.locum-invite-public-mode #branch-view-bar {
            display: none !important;
        }
        body.locum-invite-public-mode #app-content {
            flex: 1 1 auto;
            min-height: 100vh;
            padding: 1.5rem !important;
            background: #0f172a !important;
        }
        body.locum-invite-public-mode #main-app > main {
            background: #0f172a;
        }

        .nexus-brand-logo {
            display: block;
            height: auto;
            width: auto;
            max-width: 100%;
            object-fit: contain;
            object-position: left center;
        }
        #sidebar .nexus-brand-logo {
            width: 100%;
            max-width: 100%;
            height: auto;
            max-height: 5.25rem;
            background: transparent;
        }
        .nexus-brand-logo-wrap--login {
            background: linear-gradient(180deg, #121a2e 0%, #0f172a 100%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 1rem;
            padding: 1rem 1.125rem;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .nexus-brand-logo--login {
            width: 100%;
            max-height: 5.75rem;
            max-width: 22rem;
            height: auto;
            margin: 0;
            object-position: center;
        }
        .nexus-brand-logo-wrap--public {
            background: #0f172a;
            border-radius: 0.75rem;
            padding: 0.625rem 0.875rem;
            display: inline-flex;
            justify-content: center;
            align-items: center;
        }
        .nexus-brand-logo--public {
            max-height: 3.25rem;
            max-width: 16rem;
            width: auto;
            height: auto;
            margin: 0;
            object-position: center;
        }

        .locum-public-loading-overlay {
            position: fixed;
            inset: 0;
            z-index: 10050;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(15, 23, 42, 0.82);
            backdrop-filter: blur(4px);
        }
        .locum-public-loading-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            padding: 2rem 2.5rem;
            border-radius: 1rem;
            background: rgba(255, 255, 255, 0.98);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
            max-width: 20rem;
            text-align: center;
        }
        .locum-public-loading-spinner {
            width: 2.5rem;
            height: 2.5rem;
            border: 3px solid #e2e8f0;
            border-top-color: #059669;
            border-radius: 50%;
            animation: locum-public-spin 0.75s linear infinite;
        }
        .locum-public-loading-text {
            margin: 0;
            font-size: 0.875rem;
            font-weight: 600;
            color: #334155;
            line-height: 1.4;
        }
        @keyframes locum-public-spin {
            to { transform: rotate(360deg); }
        }

        /* â”€â”€ Nexus boot / action loader: breathe â†’ spin â†’ finish â”€â”€ */
        .nexus-boot-loader {
            position: relative;
            z-index: 1;
        }
        .nexus-boot-stage {
            position: relative;
            width: 7.5rem;
            height: 7.5rem;
            margin-bottom: 1.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .nexus-boot-breath {
            position: absolute;
            inset: 8%;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(45, 212, 191, 0.55) 0%, rgba(13, 148, 136, 0.22) 42%, transparent 70%);
            filter: blur(10px);
            opacity: 0.35;
            transform: scale(0.72);
            animation: nexus-boot-breathe 2.4s ease-in-out infinite;
            pointer-events: none;
        }
        .nexus-boot-breath--soft {
            inset: -6%;
            background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(14, 116, 144, 0.12) 45%, transparent 72%);
            filter: blur(18px);
            animation-delay: -1.2s;
            opacity: 0.25;
        }
        .nexus-boot-core {
            position: relative;
            width: 0.85rem;
            height: 0.85rem;
            border-radius: 50%;
            background: #5eead4;
            box-shadow:
                0 0 12px rgba(45, 212, 191, 0.9),
                0 0 28px rgba(13, 148, 136, 0.55);
            opacity: 0;
            transform: scale(0.4);
            animation: nexus-boot-core-in 0.9s ease-out 0.55s forwards,
                       nexus-boot-core-pulse 2.4s ease-in-out 1.4s infinite;
        }
        .nexus-boot-ring {
            position: absolute;
            inset: 18%;
            border-radius: 50%;
            opacity: 0;
            transform: scale(0.85);
            animation: nexus-boot-ring-in 0.7s ease-out 1.1s forwards;
        }
        .nexus-boot-ring-arc {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 2.5px solid transparent;
            border-top-color: #5eead4;
            border-right-color: rgba(94, 234, 212, 0.35);
            box-shadow: 0 0 18px rgba(45, 212, 191, 0.35);
            /* Spin lives on the arc so it does not fight the ring fade-in transform */
            animation: nexus-boot-spin 1.15s linear infinite;
            will-change: transform;
        }
        .nexus-boot-msg {
            letter-spacing: 0.18em;
            opacity: 0;
            animation: nexus-boot-msg-in 0.6s ease-out 0.35s forwards;
        }
        .nexus-boot-loader.nexus-boot-finishing .nexus-boot-breath {
            animation: nexus-boot-breathe-peak 0.55s ease-out forwards;
        }
        .nexus-boot-loader.nexus-boot-finishing .nexus-boot-ring {
            animation: nexus-boot-ring-out 0.7s ease-in 0.15s forwards;
        }
        .nexus-boot-loader.nexus-boot-finishing .nexus-boot-ring-arc {
            animation: nexus-boot-spin 0.45s linear infinite;
        }
        .nexus-boot-loader.nexus-boot-finishing .nexus-boot-core {
            animation: nexus-boot-core-flash 0.65s ease-out forwards;
        }
        .nexus-boot-loader.nexus-boot-finishing .nexus-boot-msg,
        .nexus-boot-loader.nexus-boot-finishing #auth-loader-sub,
        .nexus-boot-loader.nexus-boot-finishing > button {
            animation: nexus-boot-fade-out 0.4s ease-out forwards;
        }
        #login-view.nexus-boot-reveal-out {
            animation: nexus-boot-veil-out 0.55s ease-in forwards;
            pointer-events: none;
        }
        @keyframes nexus-boot-breathe {
            0%, 100% { opacity: 0.28; transform: scale(0.72); }
            50% { opacity: 0.95; transform: scale(1.12); }
        }
        @keyframes nexus-boot-breathe-peak {
            0% { opacity: 0.7; transform: scale(1); }
            55% { opacity: 1; transform: scale(1.45); }
            100% { opacity: 0; transform: scale(1.85); }
        }
        @keyframes nexus-boot-core-in {
            to { opacity: 1; transform: scale(1); }
        }
        @keyframes nexus-boot-core-pulse {
            0%, 100% { box-shadow: 0 0 12px rgba(45, 212, 191, 0.85), 0 0 26px rgba(13, 148, 136, 0.45); }
            50% { box-shadow: 0 0 18px rgba(94, 234, 212, 1), 0 0 40px rgba(13, 148, 136, 0.7); }
        }
        @keyframes nexus-boot-core-flash {
            0% { opacity: 1; transform: scale(1); }
            40% { opacity: 1; transform: scale(1.55); filter: brightness(1.4); }
            100% { opacity: 0; transform: scale(0.2); }
        }
        @keyframes nexus-boot-ring-in {
            to { opacity: 1; transform: scale(1); }
        }
        @keyframes nexus-boot-ring-out {
            to { opacity: 0; transform: scale(1.35); }
        }
        @keyframes nexus-boot-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        @keyframes nexus-boot-msg-in {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes nexus-boot-fade-out {
            to { opacity: 0; }
        }
        @keyframes nexus-boot-veil-out {
            from { opacity: 1; }
            to { opacity: 0; visibility: hidden; }
        }
        @media (prefers-reduced-motion: reduce) {
            .nexus-boot-breath,
            .nexus-boot-breath--soft,
            .nexus-boot-core,
            .nexus-boot-ring,
            .nexus-boot-msg {
                animation: none !important;
                opacity: 1 !important;
                transform: none !important;
            }
            .nexus-boot-ring {
                border: 2px solid rgba(94, 234, 212, 0.45);
            }
        }

        .nexus-action-loading-overlay {
            position: fixed;
            inset: 0;
            z-index: 10060;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(15, 23, 42, 0.72);
            backdrop-filter: blur(4px);
        }
        body.nexus-action-loading {
            overflow: hidden;
        }
        .nexus-action-loading-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            padding: 2rem 2.5rem;
            border-radius: 1rem;
            background: rgba(255, 255, 255, 0.98);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
            max-width: 22rem;
            text-align: center;
        }
        .nexus-action-loading-spinner {
            width: 2.5rem;
            height: 2.5rem;
            border: 3px solid #e2e8f0;
            border-top-color: #7c3aed;
            border-radius: 50%;
            animation: nexus-action-spin 0.75s linear infinite;
        }
        .nexus-action-loading-text {
            margin: 0;
            font-size: 0.875rem;
            font-weight: 600;
            color: #334155;
            line-height: 1.4;
        }
        @keyframes nexus-action-spin {
            to { transform: rotate(360deg); }
        }

        /* Pharmacy Services PDS card spinner (do not rely on Tailwind purge for border-t-*) */
        .ps-pds-spinner {
            width: 2.5rem;
            height: 2.5rem;
            border: 4px solid #c7d2fe;
            border-top-color: #4f46e5;
            border-radius: 50%;
            animation: nexus-action-spin 0.75s linear infinite;
            flex-shrink: 0;
        }
        #ps-pds-loading.is-on {
            display: flex !important;
        }

        /* CD Register toolbar â€” single-row action buttons */
        .cd-reg-toolbar {
            scrollbar-width: thin;
        }
        .cd-reg-toolbar-btn {
            min-width: auto;
            min-height: 2.5rem;
            padding: 0.5rem 0.875rem;
            flex-shrink: 0;
            justify-content: center;
            text-align: center;
            white-space: nowrap;
        }

        /* Community feed â€” Skool-style social layout */
        .community-feed-page {
            max-width: 1100px;
            margin: 0 auto;
            padding: 1.5rem 1.25rem 3rem;
            background: #f3f4f6;
            min-height: 100%;
        }
        .community-feed-layout {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 240px;
            gap: 1.25rem;
            align-items: start;
        }
        .community-feed-main {
            min-width: 0;
        }
        .community-feed-sidebar {
            position: sticky;
            top: 1rem;
        }
        .community-feed-header { margin-bottom: 1.25rem; }
        .community-feed-title {
            font-size: 1.5rem;
            font-weight: 800;
            color: #111827;
            letter-spacing: -0.02em;
        }
        .community-feed-subtitle {
            font-size: 0.875rem;
            color: #6b7280;
            margin-top: 0.25rem;
        }
        .community-toolbar {
            background: #fff;
            border-radius: 1rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            padding: 1rem 1.25rem;
            margin-bottom: 1rem;
        }
        .community-search-wrap {
            position: relative;
            margin-bottom: 0.75rem;
        }
        .community-search-icon {
            position: absolute;
            left: 0.875rem;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
            pointer-events: none;
        }
        .community-search-input {
            width: 100%;
            border: 1px solid #e5e7eb;
            border-radius: 9999px;
            padding: 0.625rem 1rem 0.625rem 2.5rem;
            font-size: 0.875rem;
            outline: none;
        }
        .community-search-input:focus {
            border-color: #a78bfa;
            box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
        }
        .community-filter-row {
            display: flex;
            gap: 0.5rem;
            overflow-x: auto;
            padding-bottom: 0.125rem;
        }
        .community-filter-pill {
            flex-shrink: 0;
            padding: 0.375rem 0.75rem;
            border-radius: 9999px;
            border: 1px solid #e5e7eb;
            background: #fff;
            font-size: 0.8125rem;
            font-weight: 600;
            color: #6b7280;
        }
        .community-filter-pill:hover { background: #f9fafb; color: #374151; }
        .community-filter-pill--active {
            background: #ede9fe;
            border-color: #a78bfa;
            color: #6d28d9;
        }
        .community-compose-new-tag {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .community-new-tag-input {
            flex: 1;
            min-width: 10rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 0.5rem 0.75rem;
            font-size: 0.8125rem;
            outline: none;
        }
        .community-new-tag-btn {
            background: #f5f3ff;
            color: #6d28d9;
            border: 1px solid #ddd6fe;
            border-radius: 0.5rem;
            padding: 0.5rem 0.875rem;
            font-size: 0.8125rem;
            font-weight: 700;
            white-space: nowrap;
        }
        .community-new-tag-btn:hover { background: #ede9fe; }
        .community-card-top {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 1rem 1.25rem 0.5rem;
        }
        .community-pin-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            margin-left: auto;
            flex-shrink: 0;
            font-size: 0.6875rem;
            font-weight: 700;
            color: #6d28d9;
            background: #f5f3ff;
            border: 1px solid #ddd6fe;
            padding: 0.25rem 0.5rem;
            border-radius: 9999px;
            white-space: nowrap;
        }
        .community-card--pinned {
            border: 1px solid #c4b5fd;
            box-shadow: 0 2px 10px rgba(124,58,237,0.12);
            background: linear-gradient(to bottom, #faf5ff 0%, #fff 3rem);
        }
        .community-pinned-section {
            margin-bottom: 1rem;
        }
        .community-pinned-heading {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #6d28d9;
            margin-bottom: 0.625rem;
            padding: 0 0.25rem;
        }
        .community-feed-list--pinned {
            margin-bottom: 0;
        }
        .community-recent-heading {
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #9ca3af;
            margin: 0.25rem 0 0.625rem;
            padding: 0 0.25rem;
        }
        .community-pin-select {
            border: none;
            background: transparent;
            font-size: 0.75rem;
            font-weight: 700;
            color: #7c3aed;
            cursor: pointer;
            text-decoration: underline;
        }
        .community-post-tag--custom { background: #f3f4f6; color: #374151; }
        .community-compose-card {
            background: #fff;
            border-radius: 1rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            margin-bottom: 1rem;
            overflow: hidden;
        }
        .community-compose-top {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem 1.25rem;
            cursor: pointer;
        }
        .community-compose-prompt {
            flex: 1;
            color: #9ca3af;
            font-size: 0.9375rem;
            background: #f3f4f6;
            border-radius: 9999px;
            padding: 0.625rem 1rem;
        }
        .community-compose-post-btn {
            background: #7c3aed;
            color: #fff;
            font-weight: 700;
            font-size: 0.875rem;
            padding: 0.5rem 1.25rem;
            border-radius: 0.5rem;
            white-space: nowrap;
        }
        .community-compose-post-btn:hover { background: #6d28d9; }
        .community-compose-form {
            border-top: 1px solid #f3f4f6;
            padding: 1rem 1.25rem 1.25rem;
        }
        .community-compose-inner { display: flex; flex-direction: column; gap: 0.875rem; }
        .community-compose-author { font-size: 0.8125rem; color: #374151; }
        .community-compose-author strong { color: #111827; font-weight: 700; }
        .community-compose-author span { color: #6b7280; margin-left: 0.375rem; }
        .community-compose-targets { display: flex; flex-wrap: wrap; gap: 0.5rem; }
        .community-select {
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 0.5rem 0.75rem;
            font-size: 0.8125rem;
            background: #fff;
            outline: none;
        }
        .community-select:focus { border-color: #a78bfa; box-shadow: 0 0 0 2px rgba(124,58,237,0.15); }
        .community-select--grow { flex: 1; min-width: 10rem; }
        .community-compose-title {
            width: 100%;
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            padding: 0.75rem 1rem;
            font-size: 1rem;
            font-weight: 700;
            outline: none;
        }
        .community-compose-title:focus { border-color: #a78bfa; box-shadow: 0 0 0 2px rgba(124,58,237,0.12); }
        .community-compose-tags { display: flex; flex-direction: column; gap: 0.5rem; }
        .community-compose-tags-label {
            font-size: 0.6875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #6b7280;
        }
        .community-tag-pick-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
        .community-tag-pick {
            display: inline-flex;
            align-items: center;
            cursor: pointer;
        }
        .community-tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
        .community-tag-pick span {
            display: inline-block;
            padding: 0.375rem 0.75rem;
            border-radius: 9999px;
            border: 1px solid #e5e7eb;
            background: #fff;
            font-size: 0.8125rem;
            font-weight: 600;
            color: #6b7280;
            transition: background 0.15s, border-color 0.15s, color 0.15s;
        }
        .community-tag-pick input:checked + span {
            background: #ede9fe;
            border-color: #a78bfa;
            color: #6d28d9;
        }
        .community-tag-pick--none input:checked + span {
            background: #f3f4f6;
            border-color: #d1d5db;
            color: #374151;
        }
        .community-card-headline {
            padding: 0.25rem 1.25rem 0.375rem;
        }
        .community-card-title {
            font-size: 1.0625rem;
            font-weight: 800;
            color: #111827;
            line-height: 1.35;
            margin: 0.25rem 0 0;
        }
        .community-post-tag {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 700;
            padding: 0.125rem 0.5rem;
            border-radius: 9999px;
        }
        .community-post-tag--announcement { background: #ede9fe; color: #6d28d9; }
        .community-post-tag--update { background: #dbeafe; color: #1d4ed8; }
        .community-post-tag--celebration { background: #fef3c7; color: #b45309; }
        .community-compose-msg-wrap { position: relative; }
        .community-compose-msg-toolbar {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 0.375rem;
        }
        .community-compose-msg-wrap > button {
            position: static;
        }
        .community-card-link { padding: 0 1.25rem 0.875rem; }
        .community-compose-textarea {
            width: 100%;
            min-height: 6rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            padding: 0.875rem 1rem;
            font-size: 0.9375rem;
            resize: vertical;
            outline: none;
            line-height: 1.5;
        }
        .community-compose-textarea:focus { border-color: #a78bfa; box-shadow: 0 0 0 2px rgba(124,58,237,0.12); }
        .community-compose-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .community-compose-extras { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
        .community-file-label {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            font-size: 0.8125rem;
            font-weight: 600;
            color: #6b7280;
            cursor: pointer;
        }
        .community-file-label:hover { color: #7c3aed; }
        .community-evergreen-label {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            font-size: 0.8125rem;
            color: #6b7280;
            cursor: pointer;
        }
        .community-submit-btn {
            background: #7c3aed;
            color: #fff;
            font-weight: 700;
            font-size: 0.875rem;
            padding: 0.625rem 1.5rem;
            border-radius: 0.5rem;
        }
        .community-submit-btn:hover { background: #6d28d9; }
        .community-empty {
            background: #fff;
            border-radius: 1rem;
            padding: 3rem 1.5rem;
            text-align: center;
            color: #9ca3af;
            font-size: 0.9375rem;
        }
        .community-feed-list { display: flex; flex-direction: column; gap: 0.875rem; }
        .community-card {
            background: #fff;
            border-radius: 1rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            overflow: hidden;
            transition: box-shadow 0.3s, outline-color 0.3s;
        }
        .community-card--focus {
            box-shadow: 0 0 0 3px rgba(124,58,237,0.35), 0 4px 16px rgba(124,58,237,0.15);
        }
        .community-avatar {
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 9999px;
            color: #fff;
            font-weight: 800;
            font-size: 0.875rem;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .community-avatar--photo {
            background: #f3f4f6;
            overflow: hidden;
            padding: 0;
        }
        .community-avatar-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
        .community-avatar--lg { width: 2.75rem; height: 2.75rem; font-size: 1rem; }
        .community-card-meta { flex: 1; min-width: 0; }
        .community-author-line {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.25rem;
        }
        .community-author { font-weight: 700; color: #111827; font-size: 0.9375rem; }
        .community-dot { color: #d1d5db; font-size: 0.75rem; }
        .community-time { font-size: 0.8125rem; color: #9ca3af; font-weight: 500; }
        .community-author-role { font-size: 0.75rem; color: #7c3aed; font-weight: 600; margin-top: 0.125rem; }
        .community-badge {
            display: inline-block;
            margin-left: 0.375rem;
            font-size: 0.625rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            padding: 0.125rem 0.375rem;
            border-radius: 0.25rem;
        }
        .community-badge--evergreen { background: #ede9fe; color: #6d28d9; }
        .community-card-body {
            padding: 0.375rem 1.25rem 0.875rem;
            color: #1f2937;
            font-size: 0.9375rem;
            line-height: 1.6;
        }
        .community-post-media {
            margin: 0 1.25rem 0.875rem;
            border-radius: 0.625rem;
            overflow: hidden;
            background: #0f172a;
            cursor: pointer;
            position: relative;
        }
        .community-post-media--image img,
        .community-post-media-thumb {
            display: block;
            width: 100%;
            max-height: 420px;
            object-fit: cover;
        }
        .community-post-media--video { min-height: 200px; }
        .community-post-media-video-ph {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            min-height: 200px;
            color: #e2e8f0;
            font-size: 0.875rem;
            font-weight: 600;
        }
        .community-post-media-play {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0,0,0,0.22);
            pointer-events: none;
        }
        .community-post-media-play svg { width: 3rem; height: 3rem; color: #fff; fill: rgba(255,255,255,0.95); }
        .community-compose-media {
            margin: 0.75rem 0 0;
            padding: 0.875rem;
            border: 1px dashed #d1d5db;
            border-radius: 0.625rem;
            background: #fafafa;
        }
        .community-compose-media-label {
            font-size: 0.75rem;
            font-weight: 700;
            color: #374151;
            margin-bottom: 0.5rem;
        }
        .community-media-type-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 0.625rem;
        }
        .community-media-type-opt {
            font-size: 0.8125rem;
            color: #374151;
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            cursor: pointer;
        }
        .community-compose-media-hint {
            font-size: 0.6875rem;
            color: #6b7280;
            margin: 0.375rem 0 0;
            line-height: 1.4;
        }
        .community-compose-media-panel { margin-top: 0.375rem; }
        .community-compose-image-preview-wrap { margin-top: 0.625rem; }
        .community-compose-image-preview {
            max-width: 100%;
            max-height: 160px;
            border-radius: 0.5rem;
            object-fit: cover;
        }
        .community-compose-image-label { margin-top: 0.25rem; }
        .community-attachment {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            margin: 0 1.25rem 0.75rem;
            font-size: 0.75rem;
            color: #7c3aed;
            background: #f5f3ff;
            padding: 0.375rem 0.625rem;
            border-radius: 0.5rem;
        }
        .community-stats-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 1.25rem 0.625rem;
            font-size: 0.8125rem;
            color: #6b7280;
        }
        .community-stat-chips { display: inline-flex; gap: 0.125rem; }
        .community-stat-emoji {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.25rem;
            height: 1.25rem;
            font-size: 0.75rem;
            background: #f3f4f6;
            border-radius: 9999px;
        }
        .community-stats-text { font-weight: 600; }
        .community-stats-like-btn {
            background: none;
            border: none;
            padding: 0;
            margin: 0;
            font: inherit;
            font-weight: 600;
            color: inherit;
            cursor: pointer;
        }
        .community-stats-like-btn:hover {
            color: #7c3aed;
            text-decoration: underline;
        }
        .community-ack-strip {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            margin: 0 1.25rem 0.75rem;
            padding: 0.625rem 0.875rem;
            background: #fffbeb;
            border: 1px solid #fde68a;
            border-radius: 0.5rem;
            font-size: 0.8125rem;
            font-weight: 600;
            color: #92400e;
        }
        .community-ack-strip span { display: inline-flex; align-items: center; gap: 0.375rem; }
        .community-ack-strip--done {
            background: #ecfdf5;
            border-color: #a7f3d0;
            color: #047857;
            justify-content: flex-start;
        }
        .community-ack-btn {
            padding: 0.375rem 0.875rem;
            border-radius: 0.375rem;
            background: #7c3aed;
            color: #fff;
            font-size: 0.75rem;
            font-weight: 700;
            white-space: nowrap;
        }
        .community-ack-btn:hover { background: #6d28d9; }
        .community-action-bar {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.5rem 1rem;
            border-top: 1px solid #f3f4f6;
        }
        .community-action-like-wrap { position: relative; }
        .community-action-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            padding: 0.5rem 0.875rem;
            border-radius: 0.5rem;
            font-size: 0.8125rem;
            font-weight: 600;
            color: #6b7280;
            background: transparent;
        }
        .community-action-btn:hover { background: #f9fafb; color: #374151; }
        .community-action-btn--active { color: #7c3aed; }
        .community-reaction-picker {
            position: absolute;
            bottom: 100%;
            left: 0;
            margin-bottom: 0.375rem;
            display: flex;
            gap: 0.25rem;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 9999px;
            padding: 0.375rem 0.5rem;
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            z-index: 10;
        }
        .community-reaction-pick {
            font-size: 1.25rem;
            line-height: 1;
            padding: 0.25rem;
            border-radius: 9999px;
            background: transparent;
        }
        .community-reaction-pick:hover { background: #f3f4f6; transform: scale(1.15); }
        .community-reaction-pick--active { background: #ede9fe; }
        .community-mgmt-bar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.75rem;
            padding: 0.625rem 1.25rem;
            background: #f9fafb;
            border-top: 1px solid #f3f4f6;
            font-size: 0.75rem;
        }
        .community-compliance { font-weight: 700; color: #6b7280; }
        .community-compliance--done { color: #047857; }
        .community-mgmt-link { font-weight: 700; color: #7c3aed; text-decoration: underline; }
        .community-mgmt-recall { font-weight: 700; color: #be123c; margin-left: auto; }
        .community-comments-panel {
            border-top: 1px solid #f3f4f6;
            padding: 0.75rem 1.25rem 1rem;
            background: #fafafa;
        }
        .community-comments-list { max-height: 16rem; overflow-y: auto; margin-bottom: 0.75rem; }
        .community-comments-empty {
            font-size: 0.8125rem;
            color: #9ca3af;
            font-style: italic;
            padding: 0.5rem 0;
        }
        .community-comment {
            display: flex;
            gap: 0.5rem;
            padding: 0.5rem 0;
        }
        .community-comment-avatar {
            width: 1.75rem;
            height: 1.75rem;
            border-radius: 9999px;
            color: #fff;
            font-weight: 700;
            font-size: 0.6875rem;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .community-comment-avatar--self { margin-top: 0.25rem; }
        .community-comment-bubble {
            flex: 1;
            background: #f3f4f6;
            border-radius: 0.75rem;
            padding: 0.5rem 0.75rem;
            min-width: 0;
        }
        .community-comment-meta {
            display: flex;
            align-items: baseline;
            gap: 0.375rem;
            font-size: 0.6875rem;
            color: #9ca3af;
            margin-bottom: 0.125rem;
        }
        .community-comment-meta strong { color: #374151; font-size: 0.75rem; font-weight: 700; }
        .community-comment-text { font-size: 0.8125rem; color: #1f2937; line-height: 1.45; }
        .community-comment-compose {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .community-comment-input {
            flex: 1;
            border: 1px solid #e5e7eb;
            border-radius: 9999px;
            padding: 0.5rem 0.875rem;
            font-size: 0.8125rem;
            outline: none;
            background: #fff;
        }
        .community-comment-input:focus {
            border-color: #a78bfa;
            box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
        }

        /* Regular task detail modal (branch) */
        .regular-task-row {
            border: none;
            background: transparent;
            cursor: pointer;
        }
        .regular-task-row--done { opacity: 0.72; }
        .regular-task-row:focus-visible {
            outline: 2px solid #6366f1;
            outline-offset: -2px;
        }
        .regular-task-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid #e2e8f0;
            background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
            border-radius: 15px 15px 0 0;
        }
        .regular-task-modal-eyebrow {
            font-size: 0.6875rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #64748b;
            margin: 0 0 0.25rem;
        }
        .regular-task-modal-title {
            font-size: 1.25rem;
            font-weight: 800;
            color: #0f172a;
            margin: 0;
            line-height: 1.3;
        }
        .regular-task-modal-priority {
            display: inline-block;
            margin-top: 0.5rem;
            padding: 0.2rem 0.5rem;
            border-radius: 9999px;
            background: #fee2e2;
            color: #b91c1c;
            font-size: 0.625rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .regular-task-modal-body {
            padding: 1.25rem 1.5rem;
            max-height: min(70vh, 520px);
            overflow-y: auto;
        }
        .regular-task-modal-section + .regular-task-modal-section { margin-top: 1.25rem; }
        .regular-task-modal-section-title {
            font-size: 0.6875rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #64748b;
            margin: 0 0 0.5rem;
        }
        .regular-task-modal-desc {
            font-size: 0.9375rem;
            line-height: 1.6;
            color: #334155;
            white-space: pre-wrap;
        }
        .regular-task-modal-desc--empty {
            font-style: italic;
            color: #94a3b8;
            margin: 0;
        }
        .regular-task-modal-link {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            padding: 0.875rem 1rem;
            border-radius: 0.75rem;
            border: 1px solid #c7d2fe;
            background: #eef2ff;
            color: #4338ca;
            font-weight: 700;
            font-size: 0.875rem;
            text-decoration: none;
            transition: background 0.15s, border-color 0.15s;
        }
        .regular-task-modal-link:hover {
            background: #e0e7ff;
            border-color: #a5b4fc;
        }
        .regular-task-modal-link-url {
            font-size: 0.75rem;
            font-weight: 500;
            color: #6366f1;
            word-break: break-all;
        }
        .regular-task-modal-subtask-hint {
            font-size: 0.75rem;
            color: #b45309;
            background: #fffbeb;
            border: 1px solid #fde68a;
            border-radius: 0.5rem;
            padding: 0.5rem 0.75rem;
            margin: 0 0 0.75rem;
        }
        .regular-task-modal-footer {
            padding: 1rem 1.5rem 1.25rem;
            border-top: 1px solid #e2e8f0;
            background: #f8fafc;
            border-radius: 0 0 15px 15px;
        }
        .regular-task-modal-done-banner {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            border-radius: 0.75rem;
            background: #d1fae5;
            color: #047857;
            font-size: 0.875rem;
            font-weight: 700;
        }

        /* Asana-style subtasks (tickets + regular tasks) */
        .subtask-compose-block {
            border: 1px solid #e2e8f0;
            border-radius: 0.75rem;
            background: #f8fafc;
            padding: 0.875rem 1rem;
        }
        .subtask-compose-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 0.375rem;
        }
        .subtask-compose-header {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #64748b;
        }
        .subtask-compose-optional {
            font-weight: 600;
            text-transform: none;
            letter-spacing: 0;
            color: #94a3b8;
        }
        .subtask-compose-toggle {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.6875rem;
            font-weight: 700;
            color: #64748b;
            cursor: pointer;
            user-select: none;
            white-space: nowrap;
        }
        .subtask-compose-section.hidden { display: none; }
        .subtask-compose-count {
            font-size: 0.6875rem;
            font-weight: 700;
            color: #6366f1;
            margin: 0 0 0.5rem;
        }
        .subtask-compose-hint {
            font-size: 0.6875rem;
            color: #94a3b8;
            margin: 0 0 0.625rem;
            line-height: 1.4;
        }
        .subtask-compose-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.625rem; }
        .subtask-compose-row {
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            padding: 0.625rem 0.75rem;
        }
        .subtask-compose-check { color: #cbd5e1; display: flex; margin-top: 0.125rem; }
        .subtask-compose-body { flex: 1; min-width: 0; }
        .subtask-compose-text { font-size: 0.875rem; font-weight: 600; color: #1e293b; }
        .subtask-compose-desc { font-size: 0.75rem; color: #64748b; margin-top: 0.125rem; line-height: 1.35; }
        .subtask-compose-meta { font-size: 0.6875rem; color: #6366f1; margin-top: 0.25rem; font-weight: 600; }
        .subtask-compose-edit,
        .subtask-compose-remove {
            border: none; background: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0.125rem 0.25rem;
        }
        .subtask-compose-edit { color: #6366f1; }
        .subtask-compose-edit:hover { color: #4338ca; }
        .subtask-compose-remove { color: #94a3b8; }
        .subtask-compose-remove:hover { color: #ef4444; }
        .subtask-compose-add-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.375rem;
            background: #eef2ff;
            color: #4338ca;
            border: 1px dashed #c7d2fe;
            border-radius: 0.5rem;
            padding: 0.5rem 0.875rem;
            font-size: 0.8125rem;
            font-weight: 700;
            cursor: pointer;
        }
        .subtask-compose-add-btn--full { width: 100%; }
        .subtask-compose-add-btn:hover { background: #e0e7ff; }
        .subtask-panel {
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #f1f5f9;
            background: #fafafa;
        }
        .subtask-panel--compact { padding: 0.75rem 0 0; background: transparent; border-bottom: none; }
        .subtask-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #64748b;
            margin-bottom: 0.625rem;
        }
        .subtask-panel-header span:first-child { display: inline-flex; align-items: center; gap: 0.375rem; }
        .subtask-panel-count {
            font-size: 0.6875rem;
            background: #e2e8f0;
            color: #475569;
            padding: 0.125rem 0.5rem;
            border-radius: 9999px;
        }
        .subtask-panel-list { display: flex; flex-direction: column; gap: 0.375rem; }
        .subtask-row-wrap {
            display: flex;
            align-items: flex-start;
            gap: 0.25rem;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            background: #fff;
            padding: 0.125rem 0.25rem 0.125rem 0;
        }
        .subtask-row-wrap--done { opacity: 0.88; }
        .subtask-row {
            display: flex;
            align-items: flex-start;
            gap: 0.625rem;
            padding: 0.5rem 0.625rem;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: background 0.15s;
            flex: 1;
        }
        .subtask-row:hover { background: #f1f5f9; }
        .subtask-row--done .subtask-row-text {
            color: #94a3b8;
            text-decoration: line-through;
        }
        .subtask-row-content { flex: 1; min-width: 0; }
        .subtask-checkbox {
            width: 1rem;
            height: 1rem;
            margin-top: 0.2rem;
            flex-shrink: 0;
            accent-color: #4f46e5;
            cursor: pointer;
        }
        .subtask-row-text { font-size: 0.875rem; font-weight: 600; color: #334155; line-height: 1.4; display: block; }
        .subtask-row-desc { font-size: 0.8125rem; color: #64748b; margin-top: 0.25rem; line-height: 1.45; white-space: pre-wrap; }
        .subtask-row-meta { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.375rem; }
        .subtask-meta-chip {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.6875rem;
            font-weight: 600;
            color: #4338ca;
            background: #eef2ff;
            border: 1px solid #c7d2fe;
            border-radius: 9999px;
            padding: 0.125rem 0.5rem;
        }
        .subtask-meta-chip--overdue { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
        .subtask-row-edit {
            border: none; background: none; color: #6366f1; cursor: pointer; font-size: 0.875rem;
            padding: 0.5rem 0.375rem; flex-shrink: 0;
        }
        .subtask-row-edit:hover { color: #4338ca; }
        .subtask-add-inline-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            margin-top: 0.625rem;
            border: 1px dashed #c7d2fe;
            background: #fff;
            color: #4338ca;
            border-radius: 0.5rem;
            padding: 0.375rem 0.75rem;
            font-size: 0.8125rem;
            font-weight: 700;
            cursor: pointer;
        }
        .subtask-add-inline-btn:hover { background: #eef2ff; }
        .subtask-readonly { margin-top: 0.5rem; }
        .subtask-readonly-label {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.6875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #94a3b8;
        }
        .subtask-readonly-list {
            margin: 0.375rem 0 0;
            padding-left: 1.125rem;
            list-style: disc;
        }
        .subtask-readonly-item { font-size: 0.75rem; color: #64748b; margin-bottom: 0.375rem; }
        .subtask-readonly-meta { display: block; font-size: 0.6875rem; color: #6366f1; margin-top: 0.125rem; }
        .subtask-readonly-desc { font-size: 0.6875rem; color: #94a3b8; margin-top: 0.125rem; }

        /* Reference links + preview (Resource Hub style) */
        .ref-link-field { margin-top: 0.25rem; }
        .ref-link-field-label {
            display: block;
            font-size: 0.6875rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #64748b;
            margin-bottom: 0.375rem;
        }
        .ref-link-field-input {
            width: 100%;
            border: 1px solid #e2e8f0;
            border-radius: 0.75rem;
            padding: 0.625rem 0.875rem;
            font-size: 0.875rem;
            outline: none;
        }
        .ref-link-field-input:focus { border-color: #818cf8; box-shadow: 0 0 0 2px rgba(99,102,241,0.12); }
        .ref-link-field-hint { font-size: 0.6875rem; color: #94a3b8; margin-top: 0.375rem; }

        /* Resource Hub WYSIWYG description */
        .resource-wysiwyg:empty:before {
            content: 'Add details, notes, or instructions hereâ€¦';
            color: #94a3b8;
        }
        .resource-wysiwyg a {
            color: #4f46e5;
            font-weight: 700;
            text-decoration: underline;
        }
        .resource-desc-preview a {
            font-weight: 700;
            text-decoration: underline;
        }
        .resource-desc-preview p { margin: 0; }
        .ref-link-inline-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.625rem;
            font-weight: 700;
            background: #eef2ff;
            color: #4338ca;
            border: 1px solid #c7d2fe;
            border-radius: 0.5rem;
            padding: 0.25rem 0.5rem;
        }
        .ref-link-inline-btn:hover { background: #e0e7ff; }
        .ref-link-inline { color: #4f46e5; font-weight: 600; text-decoration: underline; }
        .ref-link-card {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.875rem 1rem;
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            border-radius: 0.75rem;
            transition: background 0.15s, border-color 0.15s;
            cursor: pointer;
        }
        .ref-link-card:hover { background: #dbeafe; border-color: #93c5fd; }
        .ref-link-card-icon {
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 9999px;
            background: #bfdbfe;
            color: #1d4ed8;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .ref-link-card-body { flex: 1; min-width: 0; }
        .ref-link-card-title { font-size: 0.875rem; font-weight: 700; color: #1e3a8a; }
        .ref-link-card-url { font-size: 0.75rem; color: #2563eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .ref-link-card-hint { font-size: 0.625rem; color: #60a5fa; margin-top: 0.125rem; font-weight: 600; }
        .ref-link-card-open {
            color: #2563eb;
            padding: 0.375rem;
            border-radius: 0.375rem;
            flex-shrink: 0;
        }
        .ref-link-card-open:hover { background: rgba(255,255,255,0.6); }
        .link-preview-shell { display: flex; flex-direction: column; max-height: 85vh; }
        .link-preview-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid #e2e8f0;
            background: #f8fafc;
            border-radius: 15px 15px 0 0;
        }
        .link-preview-kicker {
            font-size: 0.625rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #64748b;
        }
        .link-preview-title { font-size: 1.125rem; font-weight: 800; color: #0f172a; margin-top: 0.25rem; }
        .link-preview-domain { font-size: 0.8125rem; color: #64748b; margin-top: 0.25rem; word-break: break-all; }
        .link-preview-close { color: #94a3b8; padding: 0.25rem; }
        .link-preview-body {
            flex: 1;
            overflow: auto;
            background: #fff;
            min-height: 280px;
        }
        .link-preview-frame {
            width: 100%;
            min-height: 420px;
            height: 55vh;
            border: 0;
            display: block;
            background: #f8fafc;
        }
        .link-preview-fallback {
            padding: 2.5rem 1.5rem;
            text-align: center;
            color: #64748b;
        }
        .link-preview-fallback-icon {
            width: 4rem;
            height: 4rem;
            margin: 0 auto 1rem;
            border-radius: 9999px;
            background: #f1f5f9;
            color: #94a3b8;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .link-preview-fallback-url {
            font-size: 0.75rem;
            word-break: break-all;
            margin-top: 0.75rem;
            color: #94a3b8;
        }
        .link-preview-footer {
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
            padding: 1rem 1.5rem;
            border-top: 1px solid #e2e8f0;
            background: #f8fafc;
            border-radius: 0 0 15px 15px;
        }

        /* Community stories â€” Instagram-style 24h circles */
        .community-stories-wrap {
            background: #fff;
            border-radius: 1rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            padding: 1rem 0.75rem 0.625rem;
            margin-bottom: 1rem;
        }
        .community-stories-wrap--sidebar {
            margin-bottom: 0;
            padding: 1rem;
        }
        .community-stories-sidebar-title {
            font-size: 0.8125rem;
            font-weight: 800;
            color: #111827;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 0.75rem;
        }
        /* Community sidebar tab — inner clockwise light only, sharp outline, section height */
        .community-nav-tab {
            position: relative;
            isolation: isolate;
            overflow: hidden;
            color: #fdf4ff;
            background: linear-gradient(135deg, rgba(126, 34, 206, 0.42) 0%, rgba(79, 70, 229, 0.26) 55%, rgba(109, 40, 217, 0.2) 100%) !important;
            border: 1.5px solid rgba(240, 171, 252, 0.88) !important;
            box-shadow:
                inset 0 0 0 1px rgba(255, 255, 255, 0.22),
                inset 0 1px 0 rgba(255, 255, 255, 0.14);
        }
        .community-nav-tab::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 220%;
            height: 220%;
            transform: translate(-50%, -50%);
            background: conic-gradient(
                from 0deg,
                transparent 0deg,
                transparent 252deg,
                rgba(255, 255, 255, 0.04) 270deg,
                rgba(255, 255, 255, 0.22) 290deg,
                rgba(255, 255, 255, 0.48) 305deg,
                rgba(255, 255, 255, 0.22) 320deg,
                rgba(255, 255, 255, 0.04) 338deg,
                transparent 352deg,
                transparent 360deg
            );
            animation: community-nav-inner-spin 2.8s linear infinite;
            pointer-events: none;
            z-index: 0;
        }
        @keyframes community-nav-inner-spin {
            to { transform: translate(-50%, -50%) rotate(360deg); }
        }
        .community-nav-tab > div,
        .community-nav-tab > span {
            position: relative;
            z-index: 1;
        }
        .community-nav-tab:hover {
            border-color: #f5d0fe !important;
            box-shadow:
                inset 0 0 0 1px rgba(255, 255, 255, 0.32),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }
        .community-nav-tab--active,
        .nav-item.community-nav-tab.community-nav-tab--active {
            border-color: #ffffff !important;
            background: linear-gradient(135deg, rgba(147, 51, 234, 0.52) 0%, rgba(99, 102, 241, 0.36) 100%) !important;
            box-shadow:
                inset 0 0 0 1px rgba(255, 255, 255, 0.38),
                inset 0 1px 0 rgba(255, 255, 255, 0.24);
        }
        .community-nav-badge {
            position: relative;
            z-index: 1;
            min-width: 1.15rem;
            height: 1.15rem;
            padding: 0 0.32rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 9999px;
            background: #d946ef;
            color: #fff;
            font-size: 0.625rem;
            font-weight: 800;
            line-height: 1;
            box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
        }
        .community-nav-badge--pulse {
            animation: community-nav-badge-pulse 2s ease-in-out infinite;
        }
        @keyframes community-nav-badge-pulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.08); opacity: 0.92; }
        }
        .community-stories-row {
            display: flex;
            gap: 0.875rem;
            overflow-x: auto;
            padding: 0 0.25rem 0.375rem;
            scrollbar-width: thin;
        }
        .community-stories-row--sidebar {
            flex-direction: column;
            overflow-x: hidden;
            overflow-y: auto;
            max-height: calc(100vh - 10rem);
            padding: 0;
            gap: 0.625rem;
        }
        .community-stories-row--sidebar .community-story-item {
            width: 100%;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 0.625rem;
            text-align: left;
            padding: 0.375rem 0.25rem;
            border-radius: 0.625rem;
        }
        .community-stories-row--sidebar .community-story-item:hover {
            background: #f9fafb;
        }
        .community-stories-row--sidebar .community-story-ring {
            width: 3rem;
            height: 3rem;
            margin: 0;
            flex-shrink: 0;
        }
        .community-stories-row--sidebar .community-story-label {
            max-width: none;
            flex: 1;
            margin-top: 0;
            font-size: 0.8125rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .community-stories-row--sidebar .community-story-add-badge {
            right: auto;
            left: 2.1rem;
            top: 2.1rem;
        }
        .community-stories-empty {
            font-size: 0.8125rem;
            color: #9ca3af;
            text-align: center;
            padding: 0.5rem 0;
        }
        @media (max-width: 900px) {
            .community-feed-layout {
                grid-template-columns: 1fr;
            }
            .community-feed-sidebar {
                position: static;
                order: -1;
            }
            .community-stories-wrap--sidebar {
                margin-bottom: 1rem;
            }
            .community-stories-row--sidebar {
                flex-direction: row;
                overflow-x: auto;
                overflow-y: hidden;
                max-height: none;
            }
            .community-stories-row--sidebar .community-story-item {
                flex-direction: column;
                width: 4.5rem;
                text-align: center;
                padding: 0;
            }
            .community-stories-row--sidebar .community-story-ring {
                width: 4rem;
                height: 4rem;
                margin: 0 auto;
            }
            .community-stories-row--sidebar .community-story-label {
                font-size: 0.6875rem;
                max-width: 4.5rem;
            }
        }

        /* Ticket detail â€” compact ops toolbar */
        .ticket-ops-wrap {
            border-bottom: 1px solid #e2e8f0;
            background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
        }
        .ticket-ops-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
            padding: 0.625rem 1rem;
        }
        .ticket-ops-tab {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            padding: 0.375rem 0.75rem;
            font-size: 0.6875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #64748b;
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .ticket-ops-tab:hover { color: #4338ca; border-color: #c7d2fe; background: #eef2ff; }
        .ticket-ops-tab--active {
            color: #4338ca;
            background: #eef2ff;
            border-color: #818cf8;
            box-shadow: 0 1px 2px rgba(67, 56, 202, 0.12);
        }
        .ticket-ops-panel {
            padding: 0.875rem 1rem 1rem;
            border-top: 1px solid #e2e8f0;
            background: #fff;
        }
        .ticket-ops-panel-head {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.375rem;
            font-size: 0.75rem;
            font-weight: 700;
            color: #334155;
            margin-bottom: 0.5rem;
        }
        .ticket-ops-badge {
            font-size: 0.625rem;
            font-weight: 700;
            color: #5b21b6;
            background: #ede9fe;
            border: 1px solid #ddd6fe;
            border-radius: 9999px;
            padding: 0.125rem 0.5rem;
        }
        .ticket-ops-hint {
            font-size: 0.6875rem;
            color: #64748b;
            margin: 0 0 0.625rem;
            line-height: 1.4;
        }
        .ticket-ops-deadline {
            font-size: 0.75rem;
            color: #4338ca;
            margin: 0 0 0.5rem;
        }
        .ticket-ops-suggest {
            font-size: 0.6875rem;
            color: #92400e;
            background: #fffbeb;
            border: 1px solid #fde68a;
            border-radius: 0.5rem;
            padding: 0.5rem 0.625rem;
            margin-bottom: 0.5rem;
        }
        .ticket-ops-link-btn {
            font-size: 0.625rem;
            font-weight: 700;
            color: #b45309;
            text-decoration: underline;
            background: none;
            border: none;
            cursor: pointer;
            margin-left: 0.25rem;
        }
        .ticket-ops-select {
            width: 100%;
            max-width: 320px;
            border: 1px solid #cbd5e1;
            border-radius: 0.5rem;
            padding: 0.5rem 0.625rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: #334155;
            background: #fff;
        }
        .ticket-ops-select--grow { flex: 1; max-width: none; }
        .ticket-ops-inline-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }
        .ticket-ops-label {
            display: block;
            font-size: 0.625rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #94a3b8;
            margin-bottom: 0.25rem;
        }
        .ticket-ops-input,
        .ticket-ops-textarea {
            width: 100%;
            border: 1px solid #cbd5e1;
            border-radius: 0.5rem;
            padding: 0.5rem 0.625rem;
            font-size: 0.8125rem;
            color: #334155;
        }
        .ticket-sla-presets {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
            margin-bottom: 0.625rem;
        }
        .ticket-sla-preset {
            padding: 0.25rem 0.625rem;
            font-size: 0.6875rem;
            font-weight: 700;
            color: #5b21b6;
            background: #f5f3ff;
            border: 1px solid #ddd6fe;
            border-radius: 9999px;
            cursor: pointer;
        }
        .ticket-sla-preset:hover,
        .ticket-sla-preset--active {
            background: #7c3aed;
            color: #fff;
            border-color: #7c3aed;
        }
        .ticket-sla-form-row {
            display: grid;
            grid-template-columns: 7rem 1fr;
            gap: 0.625rem;
            margin-bottom: 0.5rem;
        }
        @media (max-width: 640px) {
            .ticket-sla-form-row { grid-template-columns: 1fr; }
        }
        .ticket-sla-preview {
            font-size: 0.75rem;
            color: #4338ca;
            background: #eef2ff;
            border: 1px solid #c7d2fe;
            border-radius: 0.5rem;
            padding: 0.5rem 0.625rem;
            margin: 0 0 0.625rem;
        }
        .ticket-sla-form-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }
        .ticket-sla-disable-inline {
            border-top: 1px dashed #e2e8f0;
            padding-top: 0.75rem;
        }
        .ticket-sla-history {
            margin: 0.75rem 0 0;
            padding: 0.5rem 0 0 1rem;
            font-size: 0.6875rem;
            color: #64748b;
            border-top: 1px dashed #e2e8f0;
        }
        .ticket-sla-history li { margin-bottom: 0.25rem; }

        .ticket-status-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.65rem;
            font-size: 0.6875rem;
            font-weight: 700;
            border-radius: 0.5rem;
            border: 1px solid transparent;
            transition: background 0.15s, border-color 0.15s;
            white-space: nowrap;
        }
        .ticket-status-btn--primary { background: #4f46e5; color: #fff; }
        .ticket-status-btn--primary:hover { background: #4338ca; }
        .ticket-status-btn--green { background: #059669; color: #fff; }
        .ticket-status-btn--green:hover { background: #047857; }
        .ticket-status-btn--blue { background: #2563eb; color: #fff; }
        .ticket-status-btn--blue:hover { background: #1d4ed8; }
        .ticket-status-btn--red { background: #ef4444; color: #fff; }
        .ticket-status-btn--amber { background: #d97706; color: #fff; }
        .ticket-status-btn--dark { background: #334155; color: #fff; }
        .ticket-status-btn--wa { background: #25D366; color: #fff; text-decoration: none; }
        .ticket-status-btn--wa:hover { background: #128C7E; color: #fff; }

        .task-compose-desc {
            min-height: 12rem;
            resize: vertical;
        }

        /* Ticket modal â€” Asana-style assignee dropdown */
        .ticket-assign-picker { z-index: 1; }
        .ticket-assign-chip {
            display: inline-block;
            font-size: 0.6875rem;
            font-weight: 600;
            color: #4338ca;
            background: #eef2ff;
            border: 1px solid #c7d2fe;
            border-radius: 9999px;
            padding: 0.125rem 0.5rem;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .community-stories-row::-webkit-scrollbar { height: 4px; }
        .community-stories-row::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
        .community-story-item {
            position: relative;
            flex: 0 0 auto;
            width: 4.5rem;
            border: none;
            background: none;
            padding: 0;
            cursor: pointer;
            text-align: center;
        }
        .community-story-ring {
            width: 4rem;
            height: 4rem;
            border-radius: 50%;
            padding: 2.5px;
            margin: 0 auto;
            background: #dbdbdb;
        }
        .community-story-ring--unviewed {
            background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        }
        .community-story-ring--add {
            background: #dbdbdb;
        }
        .community-story-ring-inner {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            padding: 2px;
            background: #fff;
            box-sizing: border-box;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .community-story-avatar {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            font-size: 1.125rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            overflow: hidden;
        }
        .community-story-avatar--sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
        .community-story-avatar.community-avatar--photo,
        .community-story-avatar .community-avatar-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .community-story-label {
            display: block;
            font-size: 0.6875rem;
            color: #374151;
            margin-top: 0.375rem;
            line-height: 1.2;
            max-width: 4.5rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .community-story-add-badge {
            position: absolute;
            right: 0.35rem;
            top: 2.75rem;
            width: 1.25rem;
            height: 1.25rem;
            border-radius: 50%;
            background: #2563eb;
            color: #fff;
            border: 2px solid #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        .community-story-add-badge svg { width: 0.75rem; height: 0.75rem; }
        .community-stories-hint {
            font-size: 0.6875rem;
            color: #9ca3af;
            text-align: center;
            margin: 0.25rem 0 0;
        }
        .community-story-viewer {
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: #000;
            display: flex;
            flex-direction: column;
        }
        .community-story-viewer-top {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            z-index: 2;
            padding: 0.75rem 1rem 0.5rem;
            background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
        }
        .community-story-progress-row {
            display: flex;
            gap: 4px;
            margin-bottom: 0.75rem;
        }
        .community-story-progress {
            flex: 1;
            height: 2px;
            background: rgba(255,255,255,0.35);
            border-radius: 9999px;
            overflow: hidden;
        }
        .community-story-progress-fill {
            height: 100%;
            width: 0;
            background: #fff;
            border-radius: 9999px;
        }
        .community-story-viewer-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: #fff;
        }
        .community-story-viewer-user {
            display: flex;
            align-items: center;
            gap: 0.625rem;
            font-size: 0.875rem;
        }
        .community-story-viewer-user strong { display: block; font-weight: 600; }
        .community-story-viewer-user span { font-size: 0.75rem; opacity: 0.85; }
        .community-story-close {
            border: none;
            background: none;
            color: #fff;
            cursor: pointer;
            padding: 0.25rem;
        }
        .community-story-close svg { width: 1.5rem; height: 1.5rem; }
        .community-story-viewer-body {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            padding: 3.5rem 0 2rem;
        }
        .community-story-image {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        .community-story-video,
        .community-story-video-frame {
            width: 100%;
            max-width: 720px;
            height: min(75vh, 720px);
            border: 0;
            background: #000;
        }
        .community-story-caption {
            position: absolute;
            bottom: 1.5rem;
            left: 1rem;
            right: 1rem;
            color: #fff;
            text-align: center;
            font-size: 0.9375rem;
            text-shadow: 0 1px 4px rgba(0,0,0,0.8);
        }
        .community-story-nav {
            position: absolute;
            top: 3.5rem;
            bottom: 0;
            width: 35%;
            border: none;
            background: transparent;
            cursor: pointer;
            z-index: 1;
        }
        .community-story-nav--prev { left: 0; }
        .community-story-nav--next { right: 0; }
        .community-story-delete {
            position: absolute;
            bottom: 1rem;
            right: 1rem;
            z-index: 3;
            border: none;
            background: rgba(0,0,0,0.45);
            color: #fff;
            border-radius: 9999px;
            width: 2.5rem;
            height: 2.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        .community-story-delete svg { width: 1.125rem; height: 1.125rem; }

        /* System Tutorials â€” Skool-style courses */
        .tutorial-hub {
            max-width: 1100px;
            margin: 0 auto;
            padding: 1.5rem 1rem 3rem;
            background: #f3f4f6;
            min-height: 100%;
        }
        .tutorial-hub-header {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        .tutorial-hub-title {
            font-size: 1.75rem;
            font-weight: 800;
            color: #111827;
            letter-spacing: -0.02em;
        }
        .tutorial-hub-subtitle { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }
        .tutorial-hub-search-wrap { position: relative; width: 100%; max-width: 280px; }
        .tutorial-hub-search-icon {
            position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
            width: 1rem; height: 1rem; color: #9ca3af;
        }
        .tutorial-hub-search {
            width: 100%; border: 1px solid #e5e7eb; border-radius: 9999px;
            padding: 0.5rem 1rem 0.5rem 2.25rem; font-size: 0.875rem; background: #fff;
        }
        .tutorial-filter-row {
            display: flex; gap: 0.75rem; margin-bottom: 1.25rem;
            align-items: center; justify-content: space-between; flex-wrap: wrap;
        }
        .tutorial-filter-pills { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .tutorial-help-btn {
            display: inline-flex; align-items: center; gap: 0.4rem;
            padding: 0.5rem 0.875rem; border-radius: 9999px;
            border: 1px solid #c7d2fe; background: #eef2ff; color: #4338ca;
            font-size: 0.75rem; font-weight: 800; cursor: pointer;
            transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
            white-space: nowrap;
        }
        .tutorial-help-btn:hover {
            background: #e0e7ff; border-color: #a5b4fc;
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
        }
        .tutorial-help-btn--compact {
            width: 2.25rem; height: 2.25rem; padding: 0; justify-content: center;
            border-radius: 0.625rem;
        }
        .tutorial-help-btn--compact i { width: 1.125rem; height: 1.125rem; }
        .tutorial-page-toprow {
            display: flex; align-items: center; justify-content: space-between;
            gap: 0.75rem; margin-bottom: 0.25rem;
        }
        .tutorial-lesson-topbar-right {
            display: flex; align-items: center; gap: 0.5rem; margin-left: auto;
        }
        .tutorial-howto-shell { background: #fff; border-radius: 15px; overflow: hidden; }
        .tutorial-howto-modal-header {
            display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
            padding: 1.25rem 1.5rem; border-bottom: 1px solid #e5e7eb;
            background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 55%, #fff 100%);
        }
        .tutorial-howto-modal-header-main {
            display: flex; align-items: flex-start; gap: 0.875rem; min-width: 0;
        }
        .tutorial-howto-modal-icon {
            width: 2.75rem; height: 2.75rem; border-radius: 0.875rem;
            background: #111827; color: #fff;
            display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
        }
        .tutorial-howto-modal-icon i { width: 1.25rem; height: 1.25rem; }
        .tutorial-howto-close {
            border: none; background: transparent; color: #94a3b8; cursor: pointer;
            padding: 0.25rem; border-radius: 0.5rem;
        }
        .tutorial-howto-close:hover { color: #475569; background: #f1f5f9; }
        .tutorial-howto-modal-eyebrow {
            font-size: 0.6875rem; font-weight: 800; text-transform: uppercase;
            letter-spacing: 0.06em; color: #6366f1; margin: 0 0 0.25rem;
        }
        .tutorial-howto-modal-title {
            font-size: 1.25rem; font-weight: 800; color: #111827; margin: 0;
        }
        .tutorial-howto-modal-sub {
            font-size: 0.8125rem; color: #6b7280; margin: 0.35rem 0 0;
        }
        .tutorial-howto-modal-body {
            padding: 1rem 1.5rem 1.25rem; max-height: min(68vh, 520px); overflow-y: auto;
        }
        .tutorial-howto-steps {
            list-style: none; margin: 0; padding: 0;
            display: flex; flex-direction: column; gap: 0.75rem;
        }
        .tutorial-howto-step {
            display: grid; grid-template-columns: auto 1fr; gap: 1rem;
            align-items: start; padding: 1rem 1.125rem;
            border: 1px solid #e5e7eb; border-radius: 0.875rem; background: #fafafa;
        }
        .tutorial-howto-step-leading {
            display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
        }
        .tutorial-howto-step-num {
            width: 1.375rem; height: 1.375rem; border-radius: 9999px;
            background: #e5e7eb; color: #374151; font-size: 0.625rem; font-weight: 800;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .tutorial-howto-step-icon {
            width: 2.25rem; height: 2.25rem; border-radius: 0.75rem;
            background: #fff; color: #111827; border: 1px solid #e5e7eb;
            display: inline-flex; align-items: center; justify-content: center;
        }
        .tutorial-howto-step-icon i { width: 1.125rem; height: 1.125rem; }
        .tutorial-howto-step-title {
            font-size: 0.9375rem; font-weight: 800; color: #111827; margin: 0 0 0.35rem;
            letter-spacing: -0.01em;
        }
        .tutorial-howto-step-text {
            font-size: 0.8125rem; line-height: 1.6; color: #4b5563;
        }
        .tutorial-howto-step-text strong { color: #111827; font-weight: 700; }
        .tutorial-howto-tip {
            display: flex; align-items: flex-start; gap: 0.625rem;
            margin-top: 1rem; padding: 0.75rem 1rem;
            border-radius: 0.75rem; background: #fffbeb; border: 1px solid #fde68a;
            font-size: 0.8125rem; color: #92400e; line-height: 1.5;
        }
        .tutorial-howto-tip i { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
        .tutorial-howto-modal-footer {
            display: flex; justify-content: flex-end; gap: 0.75rem;
            padding: 1rem 1.5rem 1.25rem; border-top: 1px solid #e5e7eb; background: #f9fafb;
            border-radius: 0 0 15px 15px;
        }
        .tutorial-filter-pill {
            border: 1px solid #d1d5db; background: #fff; border-radius: 9999px;
            padding: 0.375rem 1rem; font-size: 0.8125rem; font-weight: 600; color: #374151; cursor: pointer;
        }
        .tutorial-filter-pill--active { border-color: #111827; color: #111827; box-shadow: 0 0 0 1px #111827; }
        .tutorial-course-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
            gap: 1rem;
        }
        .tutorial-course-card {
            background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem;
            overflow: hidden; text-align: left; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s;
            padding: 0; width: 100%; display: flex; flex-direction: column; font: inherit;
            min-height: 260px; align-self: stretch;
        }
        .tutorial-course-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
        .tutorial-course-card--add {
            border: 2px dashed #d1d5db; display: flex; flex-direction: column;
            align-items: center; justify-content: center; min-height: 260px; background: #fafafa;
        }
        .tutorial-course-add-icon {
            width: 3rem; height: 3rem; border-radius: 9999px; background: #fff;
            border: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: center; color: #6366f1;
        }
        .tutorial-course-add-label { margin-top: 0.75rem; font-size: 0.875rem; font-weight: 700; color: #6b7280; }
        .tutorial-course-thumb {
            position: relative;
            height: 120px; background-size: cover; background-position: center;
            display: flex; align-items: flex-end; padding: 0.75rem;
        }
        .tutorial-course-thumb-title {
            color: #fff; font-weight: 800; font-size: 0.9375rem; text-shadow: 0 1px 4px rgba(0,0,0,0.4);
            line-height: 1.2;
            display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
        }
        .tutorial-course-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
        .tutorial-course-name { font-weight: 700; font-size: 0.9375rem; color: #111827; line-height: 1.3; }
        .tutorial-course-meta { font-size: 0.75rem; color: #9ca3af; margin-top: 0.125rem; }
        .tutorial-course-progress-row {
            display: flex; align-items: center; gap: 0.5rem; margin-top: auto; padding-top: 0.75rem;
        }
        .tutorial-course-progress-bar {
            flex: 1; min-width: 0; height: 4px; background: #e5e7eb; border-radius: 9999px; overflow: hidden;
        }
        .tutorial-course-progress-bar--lg { height: 6px; margin-top: 0.5rem; }
        .tutorial-course-progress-fill { height: 100%; background: #6366f1; border-radius: 9999px; }
        .tutorial-course-progress-text {
            font-size: 0.6875rem; font-weight: 700; color: #6b7280; white-space: nowrap; flex-shrink: 0;
        }
        .tutorial-course-lessons-count {
            font-size: 0.6875rem; color: #9ca3af; white-space: nowrap; flex-shrink: 0; margin-top: 0;
        }
        .tutorial-hub-footnote { font-size: 0.75rem; color: #9ca3af; text-align: center; margin-top: 1.5rem; }
        .tutorial-back-link {
            display: inline-flex; align-items: center; gap: 0.375rem;
            border: none; background: none; color: #6366f1; font-size: 0.875rem; font-weight: 600;
            cursor: pointer; margin-bottom: 1rem; padding: 0;
        }
        .tutorial-course-hero {
            display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem;
        }
        .tutorial-welcome { font-size: 1.125rem; font-weight: 700; color: #374151; margin-top: 0.25rem; }
        .tutorial-course-desc { font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem; max-width: 560px; }
        .tutorial-course-learner-note {
            font-size: 0.8125rem; color: #4f46e5; margin-top: 0.5rem; max-width: 560px;
            padding: 0.5rem 0.75rem; background: #eef2ff; border-radius: 0.5rem; border: 1px solid #c7d2fe;
        }
        .tutorial-course-learner-role { color: #6366f1; font-weight: 600; }
        .tutorial-continue-btn {
            background: #6366f1; color: #fff; border: none; border-radius: 9999px;
            padding: 0.625rem 1.5rem; font-weight: 700; font-size: 0.875rem; cursor: pointer; white-space: nowrap;
        }
        .tutorial-progress-card {
            background: #fff; border-radius: 1rem; border: 1px solid #e5e7eb;
            padding: 1rem 1.25rem; margin-bottom: 1.25rem;
        }
        .tutorial-progress-card-top {
            display: flex; justify-content: space-between; font-size: 0.875rem; color: #374151; margin-bottom: 0.25rem;
        }
        .tutorial-content-header {
            display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem;
        }
        .tutorial-content-header h2 { font-size: 1rem; font-weight: 800; color: #111827; margin: 0; }
        .tutorial-content-header span { font-size: 0.8125rem; color: #9ca3af; flex: 1; }
        .tutorial-manage-btn {
            display: inline-flex; align-items: center; gap: 0.25rem;
            border: 1px solid #e5e7eb; background: #fff; border-radius: 0.5rem;
            padding: 0.375rem 0.75rem; font-size: 0.75rem; font-weight: 700; color: #6366f1; cursor: pointer;
        }
        .tutorial-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 1rem; margin-bottom: 0.75rem; overflow: hidden; }
        .tutorial-section-head {
            width: 100%; display: flex; align-items: center; gap: 0.5rem;
            padding: 1rem 1.25rem; border: none; background: #fff; cursor: pointer; text-align: left;
        }
        .tutorial-section-chevron { width: 1rem; height: 1rem; color: #9ca3af; transition: transform 0.15s; }
        .tutorial-section-chevron--collapsed { transform: rotate(-90deg); }
        .tutorial-section-title { font-weight: 700; font-size: 0.9375rem; color: #111827; flex: 1; }
        .tutorial-section-meta { font-size: 0.75rem; color: #9ca3af; }
        .tutorial-lesson-list { border-top: 1px solid #f3f4f6; }
        .tutorial-lesson-row {
            width: 100%; display: flex; align-items: center; gap: 0.625rem;
            padding: 0.75rem 1.25rem; border: none; background: #fff; cursor: pointer; text-align: left;
            border-bottom: 1px solid #f9fafb;
        }
        .tutorial-lesson-row:hover { background: #f9fafb; }
        .tutorial-lesson-row--done .tutorial-lesson-title { color: #6b7280; }
        .tutorial-lesson-row--locked { opacity: 0.72; cursor: not-allowed; }
        .tutorial-lesson-row--locked:hover { background: transparent; }
        .tutorial-lesson-quiz-tag {
            display: inline-block; margin-left: 0.35rem; font-size: 0.625rem; font-weight: 800;
            text-transform: uppercase; letter-spacing: 0.04em; color: #4338ca; background: #eef2ff;
            border: 1px solid #c7d2fe; border-radius: 9999px; padding: 0.1rem 0.4rem; vertical-align: middle;
        }
        .tutorial-lesson-check {
            width: 1.25rem; height: 1.25rem; border-radius: 9999px; border: 2px solid #d1d5db;
            display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.625rem;
        }
        .tutorial-lesson-row--done .tutorial-lesson-check { background: #10b981; border-color: #10b981; color: #fff; }
        .tutorial-lesson-title { flex: 1; font-size: 0.875rem; color: #111827; }
        .tutorial-lesson-duration { font-size: 0.75rem; color: #9ca3af; }
        .tutorial-add-lesson-btn {
            width: 100%; border: none; background: #fafafa; color: #6366f1;
            padding: 0.625rem; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 0.25rem;
        }
        .tutorial-manage-bar { margin-top: 1rem; }
        .tutorial-empty { grid-column: 1 / -1; text-align: center; color: #9ca3af; padding: 2rem; }
        .tutorial-lesson-page {
            display: flex; align-items: stretch;
            height: calc(100vh - 8rem); max-height: calc(100vh - 8rem);
            background: #fff; border-radius: 1rem; border: 1px solid #e5e7eb; overflow: hidden;
        }
        .tutorial-lesson-main { flex: 1; padding: 1.25rem 1.5rem; overflow-y: auto; min-width: 0; min-height: 0; }
        .tutorial-lesson-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
        .tutorial-lesson-nav-btns { display: flex; align-items: center; gap: 0.5rem; }
        .tutorial-lesson-nav-btn {
            border: 1px solid #e5e7eb; background: #fff; border-radius: 0.5rem;
            width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; cursor: pointer;
        }
        .tutorial-lesson-nav-btn--disabled {
            opacity: 0.35; cursor: not-allowed; border-style: dashed;
        }
        .tutorial-lesson-counter { font-size: 0.8125rem; color: #6b7280; }
        .tutorial-lesson-heading { font-size: 1.25rem; font-weight: 800; color: #111827; margin-bottom: 1rem; }
        .tutorial-video-wrap {
            background: #000; border-radius: 0.75rem; overflow: hidden; aspect-ratio: 16/9; margin-bottom: 1rem;
        }
        .tutorial-video-frame { width: 100%; height: 100%; border: 0; display: block; }
        .tutorial-no-video {
            height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
            color: #9ca3af; gap: 0.5rem; padding: 2rem; text-align: center;
        }
        .tutorial-lesson-desc { font-size: 0.9375rem; color: #374151; line-height: 1.6; margin-bottom: 1rem; }
        .tutorial-lesson-qa {
            width: 320px; border-left: 1px solid #e5e7eb; background: #fafafa;
            display: flex; flex-direction: column; flex-shrink: 0;
            height: 100%; min-height: 0; overflow: hidden;
        }
        .tutorial-lesson-qa-head {
            display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
            padding: 1rem; border-bottom: 1px solid #e5e7eb; background: #fff; flex-shrink: 0;
        }
        .tutorial-lesson-qa-head-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
        .tutorial-lesson-qa-title {
            display: inline-flex; align-items: center; gap: 0.35rem;
            font-size: 0.875rem; font-weight: 800; color: #4338ca;
        }
        .tutorial-lesson-qa-subtitle { font-size: 0.6875rem; color: #6b7280; line-height: 1.3; }
        .tutorial-lesson-qa-clear {
            border: none; background: transparent; color: #6b7280; font-size: 0.6875rem;
            font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0;
        }
        .tutorial-lesson-qa-clear:hover { color: #374151; }
        .tutorial-lesson-qa-messages {
            flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.625rem;
            min-height: 0;
        }
        .tutorial-lesson-qa-empty {
            font-size: 0.8125rem; color: #9ca3af; line-height: 1.5; text-align: center; padding: 2rem 0.5rem;
        }
        .tutorial-lesson-qa-msg { border-radius: 0.625rem; padding: 0.5rem 0.75rem; font-size: 0.8125rem; line-height: 1.5; }
        .tutorial-lesson-qa-msg--user { background: #eef2ff; color: #312e81; align-self: flex-end; max-width: 92%; }
        .tutorial-lesson-qa-msg--assistant { background: #fff; border: 1px solid #e5e7eb; color: #374151; align-self: flex-start; max-width: 100%; }
        .tutorial-lesson-qa-msg--pending { opacity: 0.7; font-style: italic; }
        .tutorial-lesson-qa-msg-label {
            font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
            color: #9ca3af; margin-bottom: 0.25rem;
        }
        .tutorial-lesson-qa-msg-body { white-space: pre-wrap; word-break: break-word; }
        .tutorial-lesson-qa-msg-body--rich { white-space: normal; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-p { margin: 0.35rem 0; line-height: 1.45; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-h { margin: 0.55rem 0 0.25rem; font-weight: 800; color: #312e81; line-height: 1.3; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-h1, .tutorial-lesson-qa-msg-body--rich .ai-chat-h2 { font-size: 0.875rem; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-h3, .tutorial-lesson-qa-msg-body--rich .ai-chat-h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: #4338ca; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-ul, .tutorial-lesson-qa-msg-body--rich .ai-chat-ol { margin: 0.35rem 0 0.5rem; padding-left: 1.15rem; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-ul { list-style: disc; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-ol { list-style: decimal; }
        .tutorial-lesson-qa-msg-body--rich li { margin: 0.2rem 0; line-height: 1.4; }
        .tutorial-lesson-qa-msg-body--rich strong { font-weight: 800; color: #1e1b4b; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-code { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 0.25rem; padding: 0.05rem 0.3rem; font-size: 0.75rem; font-family: ui-monospace, monospace; }
        .tutorial-lesson-qa-msg-body--rich .ai-chat-link { color: #4f46e5; font-weight: 700; text-decoration: underline; }
        .tutorial-lesson-qa-input-row {
            display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 1rem 1rem;
            border-top: 1px solid #e5e7eb; background: #fff; flex-shrink: 0;
        }
        .tutorial-lesson-qa-input {
            width: 100%; border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.625rem 0.75rem;
            font-size: 0.8125rem; resize: none; font-family: inherit; min-height: 2.75rem;
        }
        .tutorial-lesson-qa-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.15); }
        .tutorial-lesson-qa-input:disabled { background: #f3f4f6; color: #9ca3af; }
        .tutorial-lesson-qa-send {
            width: 100%; background: #6366f1; color: #fff; border: none; border-radius: 0.5rem;
            padding: 0.625rem 1rem; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
        }
        .tutorial-lesson-qa-send:hover:not(:disabled) { background: #4f46e5; }
        .tutorial-lesson-qa-send:disabled { opacity: 0.5; cursor: not-allowed; }
        .tutorial-lesson-qa-hint {
            padding: 0 1rem 0.75rem; margin: 0; font-size: 0.6875rem; color: #9ca3af; line-height: 1.4;
        }
        .tutorial-transcript {
            border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 0.75rem 1rem; margin-bottom: 1rem;
        }
        .tutorial-transcript summary { font-weight: 700; font-size: 0.8125rem; cursor: pointer; color: #6366f1; }
        .tutorial-transcript-body {
            margin-top: 0.75rem; font-size: 0.8125rem; color: #4b5563; line-height: 1.6;
            max-height: 240px; overflow-y: auto; white-space: pre-wrap;
        }
        .tutorial-summary {
            border: 1px solid #bbf7d0; border-radius: 0.75rem; padding: 0.75rem 1rem; margin-bottom: 1rem; background: #f0fdf4;
        }
        .tutorial-summary summary { font-weight: 700; font-size: 0.8125rem; cursor: pointer; color: #166534; }
        .tutorial-summary-body {
            margin-top: 0.75rem; font-size: 0.8125rem; color: #14532d; line-height: 1.6;
            max-height: 240px; overflow-y: auto; white-space: pre-wrap;
        }
        .tutorial-lesson-quiz-badge {
            display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 700;
            color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 9999px;
            padding: 0.25rem 0.75rem; margin-bottom: 0.75rem;
        }
        .tutorial-lesson-quiz {
            border: 1px solid #c7d2fe; border-radius: 0.75rem; padding: 1rem 1.125rem; margin-bottom: 1rem;
            background: linear-gradient(180deg, #f5f3ff 0%, #fff 100%);
        }
        .tutorial-lesson-quiz--passed { border-color: #86efac; background: #f0fdf4; }
        .tutorial-lesson-quiz--locked { border-color: #fecaca; background: #fef2f2; }
        .tutorial-lesson-quiz-head {
            display: flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; font-weight: 800; color: #312e81;
            margin-bottom: 0.35rem;
        }
        .tutorial-lesson-quiz--passed .tutorial-lesson-quiz-head { color: #166534; }
        .tutorial-lesson-quiz--locked .tutorial-lesson-quiz-head { color: #b91c1c; }
        .tutorial-lesson-quiz-note { font-size: 0.8125rem; color: #4b5563; margin: 0 0 0.75rem; line-height: 1.45; }
        .tutorial-quiz-questions { display: flex; flex-direction: column; gap: 0.875rem; }
        .tutorial-quiz-q-label { font-size: 0.875rem; font-weight: 700; color: #111827; margin-bottom: 0.5rem; }
        .tutorial-quiz-options { display: flex; flex-direction: column; gap: 0.375rem; }
        .tutorial-quiz-option {
            display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.8125rem; color: #374151;
            border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 0.5rem 0.625rem; cursor: pointer;
            background: #fff;
        }
        .tutorial-quiz-option:hover { border-color: #a5b4fc; background: #faf5ff; }
        .tutorial-quiz-option input { margin-top: 0.35rem; flex-shrink: 0; }
        .tutorial-quiz-letter {
            flex-shrink: 0; width: 1.35rem; height: 1.35rem; margin-top: 0.05rem;
            display: inline-flex; align-items: center; justify-content: center;
            border-radius: 0.35rem; background: #eef2ff; color: #4338ca;
            font-size: 0.6875rem; font-weight: 800; line-height: 1;
        }
        .tutorial-quiz-option-text { flex: 1; min-width: 0; line-height: 1.4; padding-top: 0.1rem; }
        .tutorial-quiz-option.is-correct .tutorial-quiz-letter {
            background: #dcfce7; color: #166534;
        }
        .tutorial-quiz-option.is-wrong .tutorial-quiz-letter {
            background: #fee2e2; color: #b91c1c;
        }
        .tutorial-lesson-quiz.is-revealed .tutorial-quiz-option {
            cursor: default; pointer-events: none;
        }
        .tutorial-lesson-quiz.is-revealed .tutorial-quiz-option:hover {
            border-color: #e5e7eb; background: #fff;
        }
        .tutorial-quiz-option.is-correct {
            border-color: #86efac !important;
            background: #f0fdf4 !important;
            color: #166534;
            font-weight: 700;
            box-shadow: inset 0 0 0 1px #86efac;
        }
        .tutorial-quiz-option.is-correct::after {
            content: 'Correct';
            margin-left: auto;
            font-size: 0.65rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #15803d;
            flex-shrink: 0;
        }
        .tutorial-quiz-option.is-wrong {
            border-color: #fca5a5 !important;
            background: #fef2f2 !important;
            color: #b91c1c;
            font-weight: 700;
            box-shadow: inset 0 0 0 1px #fca5a5;
        }
        .tutorial-quiz-option.is-wrong::after {
            content: 'Your answer';
            margin-left: auto;
            font-size: 0.65rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #dc2626;
            flex-shrink: 0;
        }
        .tutorial-quiz-submit:disabled {
            opacity: 0.65; cursor: default; background: #818cf8;
        }
        .tutorial-quiz-result { margin-top: 0.75rem; }
        .tutorial-quiz-result-pass { font-size: 0.875rem; font-weight: 700; color: #166534; margin: 0; }
        .tutorial-quiz-result-fail { font-size: 0.875rem; font-weight: 700; color: #b91c1c; margin: 0; }
        .tutorial-quiz-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
        .tutorial-quiz-submit, .tutorial-quiz-retry {
            border-radius: 9999px; padding: 0.45rem 1rem; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
        }
        .tutorial-quiz-submit { background: #6366f1; color: #fff; border: none; }
        .tutorial-quiz-submit:hover { background: #4f46e5; }
        .tutorial-quiz-retry { background: #fff; color: #4338ca; border: 1px solid #c7d2fe; }
        .tutorial-quiz-draft-preview {
            max-height: 180px; overflow-y: auto; border: 1px dashed #c7d2fe; border-radius: 0.5rem;
            padding: 0.5rem 0.625rem; background: #fff;
        }
        .tutorial-quiz-draft-item { font-size: 0.75rem; color: #374151; line-height: 1.45; margin-bottom: 0.35rem; }
        .tutorial-quiz-draft-answer { color: #6b7280; }
        .tutorial-quiz-draft-empty { font-size: 0.75rem; color: #9ca3af; margin: 0; }
        .tutorial-lesson-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
        .tutorial-complete-btn, .tutorial-next-btn, .tutorial-edit-lesson-btn {
            border-radius: 9999px; padding: 0.5rem 1.25rem; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
        }
        .tutorial-complete-btn { background: #10b981; color: #fff; border: none; display: inline-flex; align-items: center; gap: 0.35rem; }
        .tutorial-complete-btn--done { background: #047857; }
        .tutorial-next-btn--disabled {
            border-radius: 9999px; padding: 0.5rem 1.25rem; font-size: 0.8125rem; font-weight: 700;
            background: #f3f4f6; color: #9ca3af; border: 1px dashed #d1d5db;
        }
        .tutorial-learner-bar {
            display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
            background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 0.75rem;
            padding: 0.625rem 1rem; margin-bottom: 1rem;
        }
        .tutorial-learner-bar--static { background: #f9fafb; border-color: #e5e7eb; }
        .tutorial-learner-label {
            display: inline-flex; align-items: center; gap: 0.35rem;
            font-size: 0.75rem; font-weight: 800; color: #4338ca; text-transform: uppercase; letter-spacing: 0.04em;
        }
        .tutorial-learner-bar--static .tutorial-learner-label { color: #6b7280; }
        .tutorial-learner-select {
            flex: 1; min-width: 180px; border: 1px solid #c7d2fe; border-radius: 0.5rem;
            padding: 0.375rem 0.625rem; font-size: 0.8125rem; background: #fff;
        }
        .tutorial-learner-name { font-size: 0.875rem; font-weight: 700; color: #111827; }
        .tutorial-badges-strip {
            display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
            margin-bottom: 1rem; padding: 0.75rem 1rem; background: #fff;
            border: 1px solid #e5e7eb; border-radius: 0.75rem;
        }
        .tutorial-badges-strip-label {
            display: inline-flex; align-items: center; gap: 0.35rem;
            font-size: 0.6875rem; font-weight: 800; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em;
        }
        .tutorial-badges-strip-list { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
        .tutorial-badge-chip {
            display: inline-flex; align-items: center; gap: 0.25rem;
            padding: 0.25rem 0.5rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 700;
        }
        .tutorial-badge-chip--amber { background: #fef3c7; color: #92400e; }
        .tutorial-badge-chip--violet { background: #ede9fe; color: #5b21b6; }
        .tutorial-badge-chip--sky { background: #e0f2fe; color: #0369a1; }
        .tutorial-badge-chip--indigo { background: #eef2ff; color: #4338ca; }
        .tutorial-badge-chip--orange { background: #ffedd5; color: #c2410c; }
        .tutorial-badge-chip--emerald { background: #d1fae5; color: #047857; }
        .tutorial-badges-more { font-size: 0.6875rem; color: #9ca3af; font-weight: 600; }
        .tutorial-badges-strip--empty { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
        .tutorial-badges-empty-hint { font-size: 0.75rem; color: #6b7280; margin: 0; line-height: 1.4; }
        .tutorial-badge-chip--locked { opacity: 0.65; border: 1px dashed #d1d5db; background: #f9fafb !important; color: #6b7280 !important; }
        .tutorial-badge-icon {
            display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px;
        }
        .tutorial-badge-icon--sm { width: 1.125rem; height: 1.125rem; }
        .tutorial-badge-icon--sm i { width: 0.625rem; height: 0.625rem; }
        .tutorial-badge-icon--md { width: 1.75rem; height: 1.75rem; }
        .tutorial-badge-icon--md i { width: 0.875rem; height: 0.875rem; }
        .tutorial-badge-icon--lg { width: 4rem; height: 4rem; margin: 0 auto 0.75rem; }
        .tutorial-badge-icon--lg i { width: 2rem; height: 2rem; }
        .tutorial-badge-icon--amber { background: #fef3c7; color: #d97706; }
        .tutorial-badge-icon--violet { background: #ede9fe; color: #7c3aed; }
        .tutorial-badge-icon--sky { background: #e0f2fe; color: #0284c7; }
        .tutorial-badge-icon--indigo { background: #eef2ff; color: #6366f1; }
        .tutorial-badge-icon--orange { background: #ffedd5; color: #ea580c; }
        .tutorial-badge-icon--emerald { background: #d1fae5; color: #059669; }
        .tutorial-course-card--graduate { box-shadow: 0 0 0 2px #a7f3d0; }
        .tutorial-course-graduate-badge {
            position: absolute; top: 0.5rem; right: 0.5rem;
            width: 2rem; height: 2rem; border-radius: 9999px; background: rgba(255,255,255,0.95);
            color: #059669; display: flex; align-items: center; justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        .tutorial-course-access-badge {
            position: absolute; top: 0.5rem; left: 0.5rem;
            width: 1.75rem; height: 1.75rem; border-radius: 9999px; background: rgba(15,23,42,0.75);
            color: #fff; display: flex; align-items: center; justify-content: center;
        }
        .tutorial-course-access-meta { color: #6366f1; font-weight: 600; }
        .tutorial-course-access-note {
            margin-top: 0.5rem; font-size: 0.75rem; color: #6366f1; font-weight: 600;
            display: inline-flex; align-items: center; gap: 0.35rem;
        }
        .tutorial-permission-field {
            border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 0.875rem; background: #f8fafc;
        }
        .tutorial-access-radio {
            display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600;
            color: #374151; margin-bottom: 0.375rem; cursor: pointer;
        }
        .tutorial-role-check-grid {
            display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem 0.75rem;
            margin-top: 0.625rem; transition: opacity 0.15s ease;
        }
        .tutorial-role-check {
            display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: #475569; cursor: pointer;
        }
        .tutorial-access-denied .tutorial-empty--denied {
            text-align: center; max-width: 420px; margin: 3rem auto; padding: 2rem;
        }
        .tutorial-access-denied .tutorial-empty--denied h2 {
            font-size: 1.125rem; font-weight: 800; color: #111827; margin: 0.75rem 0 0.5rem;
        }
        .tutorial-access-denied .tutorial-empty--denied p {
            font-size: 0.875rem; color: #6b7280; line-height: 1.5; margin-bottom: 1rem;
        }
        .tutorial-access-denied .tutorial-empty--denied i { width: 2.5rem; height: 2.5rem; color: #9ca3af; }
        .tutorial-course-complete-banner {
            display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
            margin-top: 0.75rem; padding: 0.5rem 0.875rem; background: #ecfdf5; border: 1px solid #a7f3d0;
            border-radius: 9999px; font-size: 0.8125rem; font-weight: 700; color: #047857;
        }
        .tutorial-cert-link {
            border: none; background: #059669; color: #fff; border-radius: 9999px;
            padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 700; cursor: pointer;
        }
        .tutorial-cert-link:hover { background: #047857; }
        .tutorial-course-progress-fill--done { background: #10b981; }
        .tutorial-progress-done-note {
            margin: 0.5rem 0 0; font-size: 0.75rem; color: #059669; font-weight: 600;
            display: flex; align-items: center; gap: 0.35rem;
        }
        .tutorial-lesson-learner {
            font-size: 0.625rem; color: #6366f1; font-weight: 700; background: #eef2ff;
            padding: 0.125rem 0.375rem; border-radius: 9999px; max-width: 5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .tutorial-celebrate-overlay {
            position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,0.45);
            display: flex; align-items: center; justify-content: center; padding: 1rem;
        }
        .tutorial-celebrate-card {
            background: #fff; border-radius: 1.25rem; padding: 2rem 1.5rem; max-width: 320px; width: 100%;
            text-align: center; box-shadow: 0 25px 50px rgba(0,0,0,0.2); animation: tutorial-pop 0.35s ease-out;
        }
        @keyframes tutorial-pop {
            from { transform: scale(0.85); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }
        .tutorial-celebrate-sparkles { font-size: 1.5rem; margin-bottom: 0.5rem; }
        .tutorial-celebrate-title { font-size: 1.125rem; font-weight: 800; color: #111827; margin: 0 0 0.25rem; }
        .tutorial-celebrate-name { font-size: 1rem; font-weight: 700; color: #4338ca; margin: 0 0 0.5rem; }
        .tutorial-celebrate-desc { font-size: 0.8125rem; color: #6b7280; margin: 0 0 1.25rem; line-height: 1.5; }
        .tutorial-celebrate-btn {
            background: #6366f1; color: #fff; border: none; border-radius: 9999px;
            padding: 0.625rem 1.5rem; font-weight: 700; font-size: 0.875rem; cursor: pointer;
        }
        .tutorial-certificate {
            max-width: 100%;
            font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
            color: #0b1f33;
        }
        .tutorial-cert-sheet {
            background: #fffef9;
            border: 1px solid #c9b27a;
            box-shadow: 0 8px 28px rgba(11, 31, 51, 0.08);
            position: relative;
            overflow: hidden;
        }
        .tutorial-cert-sheet::before {
            content: "";
            position: absolute; inset: 10px;
            border: 2px solid #0b1f33;
            pointer-events: none;
        }
        .tutorial-cert-sheet::after {
            content: "";
            position: absolute; inset: 16px;
            border: 1px solid #c9b27a;
            pointer-events: none;
        }
        .tutorial-cert-inner {
            position: relative;
            z-index: 1;
            padding: 2.25rem 2rem 1.75rem;
            text-align: center;
            min-height: 22rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .tutorial-cert-org {
            display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
            margin-bottom: 0.75rem;
        }
        .tutorial-cert-org img {
            max-height: 52px; max-width: 180px; object-fit: contain;
        }
        .tutorial-cert-org-name {
            margin: 0;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.28em;
            text-transform: uppercase;
            color: #0b1f33;
        }
        .tutorial-cert-ornament {
            width: 7rem; height: 1px; background: linear-gradient(90deg, transparent, #c9b27a, transparent);
            margin: 0.35rem 0 0.85rem; position: relative;
        }
        .tutorial-cert-ornament::before,
        .tutorial-cert-ornament::after {
            content: "◆";
            position: absolute; top: 50%; transform: translateY(-50%);
            font-size: 0.45rem; color: #c9b27a;
        }
        .tutorial-cert-ornament::before { left: -0.85rem; }
        .tutorial-cert-ornament::after { right: -0.85rem; }
        .tutorial-cert-label {
            margin: 0 0 1rem;
            font-size: 1.35rem;
            font-weight: 700;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: #0b1f33;
        }
        .tutorial-cert-preamble {
            margin: 0 0 0.35rem;
            font-size: 0.8rem;
            font-style: italic;
            color: #4b5563;
        }
        .tutorial-cert-name {
            margin: 0.15rem 0 0.2rem;
            font-size: 1.85rem;
            font-weight: 700;
            color: #0b1f33;
            line-height: 1.15;
            border-bottom: 1px solid #c9b27a;
            padding: 0 0.75rem 0.2rem;
            display: inline-block;
            max-width: 95%;
        }
        .tutorial-cert-role {
            margin: 0.35rem 0 0.85rem;
            font-size: 0.78rem;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #6b7280;
        }
        .tutorial-cert-body {
            margin: 0 0 0.4rem;
            font-size: 0.9rem;
            color: #374151;
            max-width: 34rem;
            line-height: 1.5;
        }
        .tutorial-cert-course {
            margin: 0.15rem 0 1.15rem;
            font-size: 1.2rem;
            font-weight: 700;
            color: #0b1f33;
            font-style: italic;
            max-width: 36rem;
            line-height: 1.3;
        }
        .tutorial-cert-meta {
            width: 100%;
            max-width: 34rem;
            margin-top: auto;
            padding-top: 1rem;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 0.75rem;
            text-align: left;
            border-top: 1px solid #e5e0d2;
        }
        .tutorial-cert-meta-block {
            font-size: 0.68rem;
            color: #6b7280;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .tutorial-cert-meta-block strong {
            display: block;
            margin-top: 0.25rem;
            font-size: 0.82rem;
            font-weight: 700;
            letter-spacing: 0;
            text-transform: none;
            color: #0b1f33;
            font-family: Georgia, "Times New Roman", serif;
        }
        .tutorial-cert-meta-block--sign {
            text-align: center;
        }
        .tutorial-cert-sign-line {
            margin-top: 1.35rem;
            border-top: 1px solid #0b1f33;
            padding-top: 0.25rem;
            font-size: 0.72rem;
            color: #0b1f33;
            letter-spacing: 0.04em;
            text-transform: none;
            font-weight: 600;
        }
        .tutorial-cert-footer-note {
            margin: 0.85rem 0 0;
            font-size: 0.65rem;
            color: #9ca3af;
            letter-spacing: 0.04em;
        }
        @media (max-width: 640px) {
            .tutorial-cert-inner { padding: 1.5rem 1rem 1.25rem; min-height: 0; }
            .tutorial-cert-label { font-size: 1rem; letter-spacing: 0.12em; }
            .tutorial-cert-name { font-size: 1.35rem; }
            .tutorial-cert-meta { grid-template-columns: 1fr; text-align: center; }
            .tutorial-cert-meta-block, .tutorial-cert-meta-block--sign { text-align: center; }
        }
        .tutorial-ask-ai-btn {
            display: inline-flex; align-items: center; gap: 0.35rem;
            background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
            border-radius: 9999px; padding: 0.5rem 1.25rem; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
        }
        .tutorial-ask-ai-btn:hover { background: #e0e7ff; }
        .tutorial-next-btn { background: #6366f1; color: #fff; border: none; }
        .tutorial-edit-lesson-btn { background: #fff; border: 1px solid #e5e7eb; color: #374151; }
        .tutorial-lesson-sidebar {
            width: 280px; border-left: 1px solid #e5e7eb; background: #fafafa; overflow-y: auto; flex-shrink: 0;
        }
        .tutorial-sidebar-head { padding: 1rem; border-bottom: 1px solid #e5e7eb; font-size: 0.875rem; }
        .tutorial-sidebar-item {
            width: 100%; display: flex; align-items: flex-start; gap: 0.5rem;
            padding: 0.625rem 1rem; border: none; background: transparent; cursor: pointer; text-align: left;
            font-size: 0.8125rem; color: #374151; border-bottom: 1px solid #f3f4f6;
        }
        .tutorial-sidebar-item--active { background: #eef2ff; color: #4338ca; font-weight: 600; }
        .tutorial-sidebar-item--done .tutorial-lesson-check { background: #10b981; border-color: #10b981; color: #fff; }
        @media (max-width: 900px) {
            .tutorial-lesson-page {
                flex-direction: column;
                height: auto; max-height: none; overflow: visible;
            }
            .tutorial-lesson-main { overflow-y: visible; }
            .tutorial-lesson-qa {
                width: 100%; border-left: none; border-top: 1px solid #e5e7eb;
                height: auto; max-height: 420px; overflow: hidden;
            }
        }

        /* SOP reader â€” document preview + scoped Ask AI */
        .sop-reader-page {
            display: flex; align-items: stretch;
            height: calc(100vh - 8rem); max-height: calc(100vh - 8rem);
            background: #fff; border-radius: 1rem; border: 1px solid #e5e7eb; overflow: hidden;
        }
        .sop-reader-main {
            flex: 1; min-width: 0; min-height: 0; overflow-y: auto;
            padding: 1rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem;
        }
        .sop-reader-topbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
        .sop-reader-title { font-size: 1.35rem; font-weight: 800; color: #111827; line-height: 1.25; }
        .sop-reader-meta { font-size: 0.8125rem; color: #6b7280; margin: 0; }
        .sop-reader-desc { font-size: 0.875rem; color: #374151; line-height: 1.55; white-space: pre-wrap; margin: 0; }
        .sop-ai-summary-collapse summary { list-style: none; }
        .sop-ai-summary-collapse summary::-webkit-details-marker { display: none; }
        .sop-doc-preview-wrap {
            flex: 0 0 auto;
            width: 100%;
            /* Tall A4-style reading pane (~A4 page height at screen scale) */
            height: min(1123px, 85vh);
            min-height: 720px;
            display: flex; flex-direction: column;
            border: 1px solid #e5e7eb; border-radius: 0.75rem; overflow: hidden; background: #f8fafc;
            align-self: stretch;
        }
        .sop-doc-preview-bar {
            display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
            padding: 0.5rem 0.75rem; border-bottom: 1px solid #e5e7eb; background: #fff; flex-shrink: 0;
        }
        .sop-doc-preview-mount {
            flex: 1; min-height: 0; overflow: hidden;
            display: flex; flex-direction: column; background: #f1f5f9;
        }
        .sop-pdf-preview-loading {
            flex: 1; display: flex; align-items: center; justify-content: center;
            color: #64748b; font-size: 0.875rem;
        }
        .sop-pdf-preview-pages {
            flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem;
        }
        .sop-pdf-preview-pages canvas {
            width: 100%; height: auto; display: block; background: #fff;
            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12); border-radius: 0.25rem;
        }
        .sop-pdf-preview-note { font-size: 0.75rem; color: #64748b; text-align: center; padding: 0.5rem; }
        .sop-doc-preview-empty--inline { min-height: 280px; border: none; background: transparent; }
        .sop-doc-preview-frame { flex: 1; width: 100%; min-height: 0; height: 100%; border: 0; background: #fff; }
        .sop-doc-preview-html {
            flex: 1; min-height: 0; overflow: auto; padding: 1.25rem 1.5rem;
            background: #fff; color: #0f172a; font-size: 0.95rem; line-height: 1.55;
        }
        .sop-doc-preview-html img { max-width: 100%; height: auto; }
        .sop-doc-preview-html table { border-collapse: collapse; width: 100%; margin: 0.75rem 0; }
        .sop-doc-preview-html td, .sop-doc-preview-html th { border: 1px solid #e2e8f0; padding: 0.35rem 0.5rem; }
        .sop-doc-preview-text {
            flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 1rem 1.25rem;
            background: #0f172a; color: #e2e8f0; font-size: 0.8rem; line-height: 1.45;
            white-space: pre-wrap; word-break: break-word;
        }
        .sop-doc-preview-image-wrap {
            flex: 1; min-height: 0; overflow: auto; display: flex; align-items: flex-start; justify-content: center;
            padding: 1rem; background: #e2e8f0;
        }
        .sop-doc-preview-image { max-width: 100%; height: auto; background: #fff; box-shadow: 0 1px 6px rgba(15,23,42,0.12); }
        .sop-doc-preview-empty {
            flex: 1; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 0.5rem; text-align: center; color: #6b7280; font-size: 0.875rem;
            border: 1px dashed #d1d5db; border-radius: 0.75rem; padding: 2rem;
        }
        .sop-reader-ack {
            border-top: 1px solid #f1f5f9; padding-top: 0.75rem; margin-top: 0.25rem;
        }
        .sop-status-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            padding: 0.2rem 0.45rem;
            border-radius: 9999px;
            line-height: 1.2;
        }
        .sop-status-badge--ok { background: #d1fae5; color: #065f46; }
        .sop-status-badge--wait { background: #fef3c7; color: #92400e; }
        .sop-status-badge--err { background: #fee2e2; color: #991b1b; }
        .sop-status-badge--muted { background: #f1f5f9; color: #64748b; }
        .sop-reader-qa {
            width: 360px; border-left: 1px solid #e5e7eb; background: #fafafa;
            display: flex; flex-direction: column; flex-shrink: 0;
            height: 100%; min-height: 0; overflow: hidden;
        }
        .sop-reader-qa-head {
            display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
            padding: 1rem; border-bottom: 1px solid #e5e7eb; background: #fff; flex-shrink: 0;
        }
        .sop-reader-qa-head-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
        .sop-reader-qa-title {
            display: inline-flex; align-items: center; gap: 0.35rem;
            font-size: 0.875rem; font-weight: 800; color: #0f766e;
        }
        .sop-reader-qa-subtitle { font-size: 0.6875rem; color: #6b7280; line-height: 1.3; }
        .sop-reader-qa-clear {
            border: none; background: transparent; color: #6b7280; font-size: 0.6875rem;
            font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0;
        }
        .sop-reader-qa-clear:hover { color: #374151; }
        .sop-reader-qa-messages {
            flex: 1; overflow-y: auto; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.625rem;
            min-height: 0;
        }
        .sop-reader-qa-empty {
            font-size: 0.8125rem; color: #9ca3af; line-height: 1.5; text-align: center; padding: 2rem 0.5rem;
        }
        .sop-reader-qa-msg { border-radius: 0.625rem; padding: 0.5rem 0.75rem; font-size: 0.8125rem; line-height: 1.5; }
        .sop-reader-qa-msg--user { background: #ccfbf1; color: #134e4a; align-self: flex-end; max-width: 92%; }
        .sop-reader-qa-msg--assistant { background: #fff; border: 1px solid #e5e7eb; color: #374151; align-self: flex-start; max-width: 100%; }
        .sop-reader-qa-msg--pending { opacity: 0.7; font-style: italic; }
        .sop-reader-qa-msg-label {
            font-size: 0.625rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
            color: #9ca3af; margin-bottom: 0.25rem;
        }
        .sop-reader-qa-msg-body { white-space: pre-wrap; word-break: break-word; }
        .sop-reader-qa-msg-body--rich { white-space: normal; }
        .sop-reader-qa-msg-body--rich .ai-chat-p { margin: 0.35rem 0; line-height: 1.45; }
        .sop-reader-qa-msg-body--rich .ai-chat-h { margin: 0.55rem 0 0.25rem; font-weight: 800; color: #134e4a; line-height: 1.3; }
        .sop-reader-qa-msg-body--rich .ai-chat-h1, .sop-reader-qa-msg-body--rich .ai-chat-h2 { font-size: 0.875rem; }
        .sop-reader-qa-msg-body--rich .ai-chat-h3, .sop-reader-qa-msg-body--rich .ai-chat-h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: #0f766e; }
        .sop-reader-qa-msg-body--rich .ai-chat-ul, .sop-reader-qa-msg-body--rich .ai-chat-ol { margin: 0.35rem 0 0.5rem; padding-left: 1.15rem; }
        .sop-reader-qa-msg-body--rich .ai-chat-ul { list-style: disc; }
        .sop-reader-qa-msg-body--rich .ai-chat-ol { list-style: decimal; }
        .sop-reader-qa-msg-body--rich li { margin: 0.2rem 0; line-height: 1.4; }
        .sop-reader-qa-msg-body--rich strong { font-weight: 800; color: #115e59; }
        .sop-reader-qa-msg-body--rich .ai-chat-code { background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 0.25rem; padding: 0.05rem 0.3rem; font-size: 0.75rem; font-family: ui-monospace, monospace; }
        .sop-reader-qa-msg-body--rich .ai-chat-link { color: #0d9488; font-weight: 700; text-decoration: underline; }
        .sop-reader-qa-msg-model {
            margin-top: 0.35rem; font-size: 0.625rem; color: #9ca3af; font-family: ui-monospace, monospace;
        }
        .sop-reader-qa-input-row {
            display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem 1rem 1rem;
            border-top: 1px solid #e5e7eb; background: #fff; flex-shrink: 0;
        }
        .sop-reader-qa-input {
            width: 100%; border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.625rem 0.75rem;
            font-size: 0.8125rem; resize: none; font-family: inherit; min-height: 2.75rem;
        }
        .sop-reader-qa-input:focus { outline: none; border-color: #14b8a6; box-shadow: 0 0 0 2px rgba(20,184,166,0.15); }
        .sop-reader-qa-input:disabled { background: #f3f4f6; color: #9ca3af; }
        .sop-reader-qa-send {
            width: 100%; background: #0d9488; color: #fff; border: none; border-radius: 0.5rem;
            padding: 0.625rem 1rem; font-size: 0.8125rem; font-weight: 700; cursor: pointer;
        }
        .sop-reader-qa-send:hover:not(:disabled) { background: #0f766e; }
        .sop-reader-qa-send:disabled { opacity: 0.5; cursor: not-allowed; }
        .sop-reader-qa-hint {
            padding: 0 1rem 0.75rem; margin: 0; font-size: 0.6875rem; color: #9ca3af; line-height: 1.4;
        }
        .sop-extract-collapse { flex-shrink: 0; }
        @media (max-width: 900px) {
            .sop-reader-page {
                flex-direction: column;
                height: auto; max-height: none; overflow: visible;
            }
            .sop-reader-main { overflow-y: visible; }
            .sop-doc-preview-wrap {
                height: auto;
                min-height: 75vh;
                max-height: none;
            }
            .sop-reader-qa {
                width: 100%; border-left: none; border-top: 1px solid #e5e7eb;
                height: auto; max-height: 460px; overflow: hidden;
            }
        }

        /* Meeting Materials â€” compact toolbar, full-height kanban */
        .materials-board {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 5.25rem);
            min-height: 420px;
            max-width: 1600px;
            margin: 0 auto;
        }
        .materials-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem 0.75rem;
            padding: 0.35rem 0.25rem 0.5rem;
            margin-bottom: 0.35rem;
        }
        .materials-toolbar-icons {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            flex-shrink: 0;
        }
        .materials-icon-btn {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2.125rem;
            height: 2.125rem;
            border-radius: 0.625rem;
            border: 1px solid #e2e8f0;
            background: #fff;
            color: #64748b;
            cursor: pointer;
            transition: background 0.15s, color 0.15s, border-color 0.15s;
        }
        .materials-icon-btn:hover {
            background: #f5f3ff;
            color: #6d28d9;
            border-color: #c4b5fd;
        }
        .materials-icon-btn--active {
            background: #ede9fe;
            color: #5b21b6;
            border-color: #a78bfa;
        }
        .materials-icon-btn--warn {
            background: #fff7ed;
            color: #c2410c;
            border-color: #fdba74;
        }
        .materials-icon-btn--primary {
            background: #6d28d9;
            color: #fff;
            border-color: #5b21b6;
        }
        .materials-icon-btn--primary:hover {
            background: #5b21b6;
            color: #fff;
            border-color: #4c1d95;
        }
        .materials-icon-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            min-width: 1rem;
            height: 1rem;
            padding: 0 0.25rem;
            border-radius: 9999px;
            background: #f59e0b;
            color: #fff;
            font-size: 0.625rem;
            font-weight: 800;
            line-height: 1rem;
            text-align: center;
        }
        .materials-toolbar-filters {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.35rem;
            flex: 1;
            min-width: 0;
        }
        .materials-filter-select {
            border: 1px solid #ddd6fe;
            border-radius: 0.5rem;
            padding: 0.3rem 0.5rem;
            font-size: 0.6875rem;
            font-weight: 700;
            background: #fff;
            color: #5b21b6;
            max-width: 9rem;
        }
        .materials-filter-select--partner { border-color: #f5d0fe; color: #a21caf; }
        .materials-filter-select--branch { border-color: #99f6e4; color: #0f766e; }
        .materials-scope-chip {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.6875rem;
            font-weight: 700;
            padding: 0.25rem 0.5rem;
            border-radius: 0.5rem;
            background: #f5f3ff;
            color: #5b21b6;
            border: 1px solid #ddd6fe;
            white-space: nowrap;
            max-width: 10rem;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .materials-scope-chip--partner { background: #fdf4ff; color: #a21caf; border-color: #f5d0fe; }
        .materials-scope-chip--branch { background: #f0fdfa; color: #0f766e; border-color: #99f6e4; }
        .materials-type-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.25rem;
            overflow-x: auto;
        }
        .materials-type-pill {
            padding: 0.2rem 0.55rem;
            font-size: 0.6875rem;
            font-weight: 700;
            border-radius: 9999px;
            border: 1px solid #e2e8f0;
            background: #fff;
            color: #64748b;
            white-space: nowrap;
            cursor: pointer;
        }
        .materials-type-pill:hover { background: #f8fafc; color: #4338ca; }
        .materials-type-pill--active {
            background: #5b21b6;
            color: #fff;
            border-color: #5b21b6;
        }
        .materials-toolbar-search {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            flex-shrink: 0;
            margin-left: auto;
        }
        .materials-search-input {
            width: 7.5rem;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            padding: 0.35rem 0.5rem;
            font-size: 0.75rem;
            background: #f8fafc;
        }
        .materials-search-input:focus {
            outline: none;
            border-color: #8b5cf6;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
            width: 11rem;
        }
        .materials-alert {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            padding: 0.35rem 0.65rem;
            margin-bottom: 0.35rem;
            border-radius: 0.5rem;
            font-size: 0.75rem;
        }
        .materials-alert--warn {
            background: #fff1f2;
            border: 1px solid #fecdd3;
            color: #9f1239;
        }
        .materials-alert-btn {
            font-size: 0.6875rem;
            font-weight: 800;
            padding: 0.15rem 0.5rem;
            border-radius: 0.375rem;
            border: 1px solid #fda4af;
            background: #fff;
            cursor: pointer;
        }
        .materials-kanban {
            flex: 1;
            min-height: 0;
            display: flex;
            gap: 0.75rem;
            overflow-x: auto;
            overflow-y: hidden;
            padding-bottom: 0.25rem;
        }
        .materials-kanban-col {
            flex: 1 1 0;
            min-width: 200px;
            max-width: 320px;
            display: flex;
            flex-direction: column;
            min-height: 0;
            background: rgba(241, 245, 249, 0.65);
            border: 1px solid #e2e8f0;
            border-radius: 0.85rem;
        }
        .materials-board .modern-card {
            padding: 0.75rem !important;
            margin-bottom: 0.5rem !important;
            border-radius: 0.75rem;
        }
        .materials-kanban-col-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.65rem 0.85rem;
            border-bottom: 1px solid #e2e8f0;
            background: rgba(248, 250, 252, 0.9);
            border-radius: 1rem 1rem 0 0;
            flex-shrink: 0;
        }
        .materials-kanban-col-title {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .materials-kanban-count {
            font-size: 0.6875rem;
            font-weight: 800;
            padding: 0.1rem 0.45rem;
            border-radius: 9999px;
            background: #fff;
            border: 1px solid #e2e8f0;
            color: #475569;
        }
        .materials-kanban-col-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 0.65rem;
        }
        .materials-kanban-empty {
            text-align: center;
            color: #94a3b8;
            font-size: 0.75rem;
            padding: 2rem 0.5rem;
        }
        @media (min-width: 1024px) {
            .materials-search-input { width: 10rem; }
            .materials-search-input:focus { width: 14rem; }
        }
        #app-content.materials-view-active {
            padding-top: 0.5rem !important;
            padding-bottom: 0.5rem !important;
        }

        /* Issue Queue / My Work kanban — fixed viewport, scroll inside columns */
        #app-content.ops-kanban-host {
            overflow: hidden !important;
            display: flex;
            flex-direction: column;
            padding-top: 0.75rem !important;
            padding-bottom: 0.75rem !important;
        }
        #app-content.ops-kanban-host > .ops-kanban-page {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 1400px;
            margin-left: auto;
            margin-right: auto;
            gap: 1rem;
        }
        .ops-kanban-board {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            gap: 1.75rem;
            padding: 0.25rem 0.5rem 0.5rem;
            overflow-x: auto;
            overflow-y: hidden;
        }
        .ops-kanban-column {
            flex: 1 1 300px;
            min-width: 300px;
            max-width: 28rem;
            min-height: 0;
            max-height: 100%;
            display: flex;
            flex-direction: column;
            box-shadow: 0 1px 4px rgba(15, 23, 42, 0.07);
        }
        .ops-kanban-column-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* Ops month calendar — uniform day cells, scroll events inside */
        .ops-cal-card {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .ops-cal-scroll {
            flex: 1 1 auto;
            min-height: 0;
            overflow: auto;
            padding: 0.75rem;
        }
        .ops-cal-table {
            width: 100%;
            min-width: 840px;
            border-collapse: collapse;
            table-layout: fixed;
        }
        .ops-cal-table thead th {
            padding: 0.5rem;
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #64748b;
        }
        .ops-cal-day {
            height: 7.5rem;
            max-height: 7.5rem;
            padding: 0;
            vertical-align: top;
            border: 1px solid #f1f5f9;
            overflow: hidden;
            background: #fff;
        }
        .ops-cal-day--empty {
            background: rgba(248, 250, 252, 0.6);
        }
        .ops-cal-day--today {
            background: #eff6ff;
        }
        .ops-cal-day--drop {
            background: #dbeafe !important;
        }
        .ops-cal-day-inner {
            display: flex;
            flex-direction: column;
            height: 100%;
            max-height: 7.5rem;
            overflow: hidden;
            padding: 0.35rem;
        }
        .ops-cal-day-head {
            flex: 0 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.2rem;
        }
        .ops-cal-day-events {
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
        }
        .ops-cal-day-events .ops-cal-chip {
            display: block;
            width: 100%;
            text-align: left;
            font-size: 10px;
            font-weight: 700;
            line-height: 1.25;
            padding: 0.15rem 0.4rem;
            margin-bottom: 0.15rem;
            border-radius: 0.25rem;
            border-width: 1px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Android WebView embed â€” full-width module, no sidebar chrome */
        html.nexus-mobile-embed #sidebar,
        html.nexus-mobile-embed #mobile-overlay {
            display: none !important;
        }
        html.nexus-mobile-embed #main-app {
            width: 100% !important;
        }
        html.nexus-mobile-embed #main-app > main > header button[onclick*="toggleSidebar"],
        html.nexus-mobile-embed #global-ai-btn,
        html.nexus-mobile-embed #global-ai-widget {
            display: none !important;
        }
        html.nexus-mobile-embed #main-app > main > header {
            padding-left: 1rem;
            padding-right: 1rem;
        }
        html.nexus-mobile-embed #app-content,
        html.nexus-mobile-embed #expiry-view {
            padding: 0.75rem !important;
        }
        html.nexus-mobile-embed body {
            overflow: hidden;
        }

        /* â”€â”€ Ops Board health heatmap (PharmacyX-style) â”€â”€ */
        .ops-heatmap-wrap {
            border: 1px solid #e2e8f0;
        }
        .ops-heatmap-scroll {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            padding-bottom: 0.25rem;
        }
        .ops-heatmap-months,
        .ops-heatmap-days,
        .ops-heatmap-row {
            display: grid;
            gap: 2px;
            align-items: center;
            min-width: max(100%, 42rem);
            margin-bottom: 2px;
        }
        .ops-heatmap-months {
            margin-bottom: 0.15rem;
        }
        .ops-heatmap-days {
            margin-bottom: 0.35rem;
        }
        .ops-heatmap-corner {
            min-height: 0.75rem;
        }
        .ops-heatmap-days-label {
            font-size: 8px;
            font-weight: 800;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #94a3b8;
        }
        .ops-heatmap-day {
            font-size: 8px;
            font-weight: 700;
            line-height: 1;
            text-align: center;
            color: #94a3b8;
            min-width: 0;
            overflow: hidden;
            user-select: none;
        }
        .ops-heatmap-day--monthstart {
            color: #475569;
            font-weight: 900;
        }
        .ops-heatmap-day--week {
            color: #64748b;
        }
        .ops-heatmap-month {
            font-size: 9px;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: #94a3b8;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            padding-left: 1px;
        }
        .ops-heatmap-label {
            font-size: 11px;
            font-weight: 700;
            color: #334155;
            padding-right: 0.5rem;
            line-height: 1.2;
        }
        .ops-heatmap-label:hover {
            color: #0d9488;
        }
        .ops-heatmap-cell {
            aspect-ratio: 1 / 1;
            width: 100%;
            min-width: 0;
            min-height: 10px;
            max-height: 14px;
            border-radius: 2px;
            border: none;
            padding: 0;
            cursor: pointer;
            transition: transform 0.12s ease, box-shadow 0.12s ease;
        }
        .ops-heatmap-cell:hover {
            transform: scale(1.35);
            box-shadow: 0 0 0 1px #0f172a;
            z-index: 1;
            position: relative;
        }
        .ops-heatmap-cell--green { background: #22c55e; }
        .ops-heatmap-cell--amber { background: #f59e0b; }
        .ops-heatmap-cell--red { background: #ef4444; }
        .ops-heatmap-cell--none { background: #e2e8f0; }
        .ops-heatmap-legend span {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }
        .ops-heatmap-swatch {
            display: inline-block;
            width: 0.65rem;
            height: 0.65rem;
            border-radius: 2px;
            vertical-align: middle;
        }

        /* Keep Records buttons + tabs (Nexus indigo) */
        .kr-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.5rem 0.85rem;
            border-radius: 0.5rem;
            border: 1px solid #e2e8f0;
            background: #fff;
            color: #475569;
            font-size: 0.75rem;
            font-weight: 700;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
        }
        .kr-btn:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
        .kr-btn-primary {
            background: #4338ca;
            border-color: #4338ca;
            color: #fff;
        }
        .kr-btn-primary:hover { background: #3730a3; border-color: #3730a3; color: #fff; }
        .kr-btn-sm { padding: 0.35rem 0.65rem; font-size: 0.6875rem; }
        .kr-btn-ghost { background: transparent; border-color: transparent; }
        .kr-btn-ghost:hover { background: #eef2ff; border-color: #e0e7ff; color: #4338ca; }
        .kr-btn-danger { color: #b91c1c; border-color: #fecaca; background: #fff; }
        .kr-btn-danger:hover { background: #fef2f2; border-color: #fca5a5; }
        .kr-detail-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            margin-bottom: 0.75rem;
        }
        .kr-detail-tab {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.45rem 0.85rem;
            border-radius: 0.5rem;
            border: 1px solid #e2e8f0;
            background: #fff;
            color: #64748b;
            font-size: 0.75rem;
            font-weight: 700;
            cursor: pointer;
        }
        .kr-detail-tab:hover { background: #f8fafc; color: #334155; }
        .kr-detail-tab--on {
            background: #4338ca;
            border-color: #4338ca;
            color: #fff;
        }
        .kr-table th, .kr-table td { vertical-align: top; }
        .kr-table .kr-row-view-col {
            box-shadow: 2px 0 6px rgba(15, 23, 42, 0.06);
        }
        .kr-table thead .kr-row-view-col {
            background: #f8fafc;
        }
        .kr-record-table-panel {
            display: flex;
            flex-direction: column;
        }
        .kr-record-table-panel .kr-table-scroll-host {
            flex: 1 1 auto;
            min-height: 220px;
            overflow: auto;
            overscroll-behavior: contain;
        }
        .kr-table-scroll-host {
            overflow: auto;
            overscroll-behavior: contain;
            max-height: min(70vh, 720px);
        }
        .kr-table-scroll-host--branch {
            max-height: min(65vh, calc(100dvh - 16rem));
        }
        .kr-row-detail-field:last-child { border-bottom: 0; }
        #modal-backdrop:has(.kr-row-detail-modal) {
            overflow: hidden;
            align-items: center;
        }
        .kr-row-detail-modal {
            max-height: min(78dvh, 560px);
            height: min(78dvh, 560px);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .kr-row-detail-modal .kr-row-detail-head {
            background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
            color: #fff;
            border-bottom: 1px solid #312e81;
        }
        .kr-row-detail-modal .kr-row-detail-head-kicker {
            color: rgba(255, 255, 255, 0.88);
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin: 0 0 0.35rem;
        }
        .kr-row-detail-modal .kr-row-detail-head-title {
            color: #fff;
            font-size: 1rem;
            font-weight: 800;
            margin: 0;
        }
        .kr-row-detail-modal .kr-row-detail-head-close {
            color: #fff;
            background: rgba(255, 255, 255, 0.15);
            border: none;
            cursor: pointer;
        }
        .kr-row-detail-modal .kr-row-detail-head-close:hover {
            background: rgba(255, 255, 255, 0.28);
        }
        .kr-row-detail-modal .kr-row-detail-body {
            flex: 1 1 auto;
            min-height: 0;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .kr-col-resize {
            position: absolute;
            top: 0;
            right: 0;
            width: 5px;
            height: 100%;
            cursor: col-resize;
        }

        /* First-login branch roster spotlight tour */
        .nexus-roster-spotlight {
            position: fixed;
            inset: 0;
            z-index: 120;
            pointer-events: auto;
        }
        .nexus-roster-spotlight-hole {
            position: fixed;
            border-radius: 14px;
            box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.78);
            pointer-events: none;
            animation: nexus-roster-spotlight-pulse 1.8s ease-in-out infinite;
        }
        .nexus-roster-spotlight-tip {
            position: fixed;
            z-index: 121;
            width: min(300px, calc(100vw - 32px));
            background: #fff;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            padding: 1rem 1.1rem;
            box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
            animation: nexus-roster-spotlight-tip-in 0.35s ease-out;
        }
        @keyframes nexus-roster-spotlight-pulse {
            0%, 100% { outline: 3px solid rgba(20, 184, 166, 0.95); outline-offset: 2px; }
            50% { outline: 7px solid rgba(20, 184, 166, 0.35); outline-offset: 6px; }
        }
        @keyframes nexus-roster-spotlight-tip-in {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }
