*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#f1f5f9;color:#0f172a;line-height:1.5;min-height:100vh}

/* Auth */
.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem;background:linear-gradient(135deg,#f1f5f9,#e2e8f0)}
.auth-card{max-width:440px;width:100%;background:white;border-radius:2rem;box-shadow:0 20px 60px rgba(0,0,0,.08);padding:2.5rem}
@media(max-width:480px){.auth-card{padding:1.5rem}}
.auth-brand{text-align:center;margin-bottom:1.5rem}
.auth-logo{width:48px;height:48px;border-radius:12px;object-fit:cover}
.auth-brand h1{font-size:1.5rem;font-weight:700;margin-top:.5rem;background:linear-gradient(135deg,#1e40af,#3b82f6);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
.auth-tabs{display:flex;gap:.5rem;margin-bottom:1.5rem;background:#f1f5f9;border-radius:2rem;padding:.3rem}
.auth-tab{flex:1;height:32px;padding:0 .75rem;border:none;border-radius:2rem;background:transparent;font-size:.9rem;font-weight:600;cursor:pointer;color:#64748b;transition:all .2s;display:flex;align-items:center;justify-content:center}
.auth-tab.active{background:white;color:#1e293b;box-shadow:0 2px 8px rgba(0,0,0,.08)}
.form-group{margin-bottom:1rem}
.form-group label{display:block;font-size:.85rem;font-weight:600;color:#334155;margin-bottom:.3rem}
.form-error{color:#dc2626;font-size:.85rem;margin-bottom:.5rem;min-height:1.2rem}
.form-success{font-size:.85rem;margin-bottom:.5rem;min-height:1.2rem}
.required{color:#dc2626}
.auth-card input,.auth-card textarea,.auth-card select{width:100%;padding:.7rem 1rem;border:1px solid #e2e8f0;border-radius:.75rem;font-size:.95rem;outline:none;background:white;transition:border-color .2s}
.auth-card input:focus,.auth-card textarea:focus,.auth-card select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}
.auth-card .btn-primary{width:100%;justify-content:center}

/* Buttons */
.btn-primary{background:linear-gradient(135deg,#1e40af,#3b82f6);color:white;border:none;height:32px;padding:0 1.25rem;border-radius:3rem;font-size:.85rem;font-weight:600;cursor:pointer;transition:all .2s;display:inline-flex;align-items:center;gap:.5rem}
.btn-primary i{font-size:.8rem;line-height:1}

/* Card actions */
.case-card-actions{position:relative;flex-shrink:0}
.card-more-btn{width:28px;height:28px;border:none;border-radius:50%;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.82rem;transition:all .15s}
.card-more-btn:hover{background:#f1f5f9;color:#475569}
.card-dropdown{position:absolute;right:0;top:calc(100% + 4px);min-width:130px;background:white;border-radius:.75rem;box-shadow:0 8px 30px rgba(0,0,0,.12);border:1px solid #e9eef3;padding:.35rem;display:none;z-index:50}
.card-dropdown.open{display:block}
.card-dropdown .dropdown-item{display:flex;align-items:center;gap:.4rem;padding:.45rem .65rem;border-radius:.5rem;font-size:.8rem;font-weight:500;color:#334155;cursor:pointer;transition:background .1s}
.card-dropdown .dropdown-item:hover{background:#f1f5f9}
.card-dropdown .dropdown-item-danger{color:#dc2626}
.card-dropdown .dropdown-item-danger:hover{background:#fef2f2}
.case-card-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.case-card-type{margin-bottom:.5rem;min-height:1.5rem}
.case-type-label{display:inline-block;font-size:.72rem;font-weight:600;color:#1e293b;background:#e2e8f0;padding:.12rem .55rem;border-radius:2rem;letter-spacing:.02em}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(59,130,246,.35)}
.btn-primary:disabled{opacity:.5;cursor:not-allowed;transform:none}
.btn-outline{background:transparent;color:#3b82f6;border:1px solid #bfdbfe;height:32px;padding:0 1.25rem;border-radius:3rem;font-size:.85rem;font-weight:500;cursor:pointer;transition:all .2s;display:inline-flex;align-items:center;gap:.5rem}
.btn-outline:hover{background:#eff6ff}
.btn-icon{background:transparent;border:none;font-size:1.2rem;cursor:pointer;color:#64748b;padding:.5rem;border-radius:50%;transition:all .2s;width:32px;height:32px;display:flex;align-items:center;justify-content:center}
.btn-icon:hover{background:#f1f5f9;color:#1e293b}
.btn-icon-sm{background:transparent;border:none;cursor:pointer;color:#94a3b8;padding:.3rem;border-radius:50%;transition:all .2s;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}
.btn-icon-sm:hover{color:#dc2626}
.back-btn{background:white;border:none;color:#475569;font-size:.9rem;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:.4rem;height:32px;padding:0 .8rem;border-radius:2rem;transition:all .2s;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.back-btn:hover{background:#f1f5f9;color:#1e293b}

/* Dashboard */
.dashboard{max-width:1200px;margin:0 auto;padding:1.5rem}
.dash-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.5rem}
.dash-header-left h1{font-size:1.5rem;font-weight:700;color:#1e293b;display:flex;align-items:center;gap:.5rem}
.app-logo{width:32px;height:32px;border-radius:8px;object-fit:cover}
.dash-subtitle{color:#64748b;font-size:.9rem}
.dash-header-right{display:flex;align-items:center;gap:.5rem}

/* User avatar dropdown */
.user-dropdown{position:relative;display:inline-block}
.user-avatar{width:42px;height:42px;border-radius:50%;border:2px solid #e2e8f0;background:#f1f5f9;color:#475569;cursor:pointer;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:1rem;transition:all .2s;padding:0}
.user-avatar:hover{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,.15)}
.avatar-text{line-height:1}
.user-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.dropdown-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:180px;background:white;border-radius:1rem;box-shadow:0 10px 40px rgba(0,0,0,.12);border:1px solid #e9eef3;padding:.4rem;display:none;z-index:200;opacity:0;transform:translateY(-4px);transition:opacity .15s,transform .15s}
.dropdown-menu.open{display:block;opacity:1;transform:translateY(0)}
.dropdown-header{padding:.55rem .75rem}
.dropdown-username{display:block;font-weight:600;font-size:.85rem;color:#1e293b}
.dropdown-email{display:block;font-size:.75rem;color:#94a3b8;margin-top:.15rem}
.dropdown-divider{height:1px;background:#eef2f8;margin:.2rem 0}
.dropdown-item{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-radius:.7rem;font-size:.85rem;font-weight:500;color:#475569;cursor:pointer;transition:all .15s;text-decoration:none}
.dropdown-item:hover{background:#f1f5f9;color:#1e293b}
.dropdown-item i{width:1rem;text-align:center;color:#64748b;font-size:.8rem}
.dash-toolbar{display:flex;gap:.75rem;margin-bottom:1.25rem;align-items:center;flex-wrap:wrap}
.dash-toolbar .btn-primary{flex-shrink:0;padding:0 1rem;font-size:.82rem;border-radius:2rem;border:1px solid transparent}
.search-input{flex:1;min-width:120px;padding:.6rem 1rem;border:1px solid #e2e8f0;border-radius:2rem;font-size:.9rem;outline:none;background:white}
.search-input:focus{border-color:#3b82f6}
.dash-filters{display:flex;gap:.5rem;flex-wrap:wrap}
.filter-select{height:32px;padding:0 1.8rem 0 1rem;border:1px solid #e2e8f0;border-radius:2rem;font-size:.82rem;outline:none;background:white;cursor:pointer;color:#475569;transition:border-color .2s;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right .65rem center;background-size:10px 6px}
.filter-select:focus{border-color:#3b82f6}
.filter-select:hover{border-color:#bfdbfe}
.case-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:1rem}
.case-card{background:white;border-radius:1.25rem;padding:1.25rem;border:1px solid #e9eef3;cursor:pointer;transition:all .2s}
.case-card:hover{border-color:#3b82f6;box-shadow:0 4px 12px rgba(59,130,246,.1)}
.case-card-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:.5rem}
.case-card-header h3{font-size:1rem;font-weight:600;color:#1e293b;transition:color .2s}
.case-card:hover .case-card-header h3{color:#2563eb}
.case-card-desc{color:#64748b;font-size:.85rem;margin-bottom:.75rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.case-card-footer{display:flex;justify-content:space-between;color:#94a3b8;font-size:.8rem}

/* Role switcher — pending (unanalyzed) role buttons */
.role-btn.pending{background:transparent;opacity:.75}
.role-btn.pending:hover{opacity:1;color:#1e293b!important}
.role-btn.pending:disabled{opacity:.5;cursor:not-allowed}

/* Badges */
.status-badge{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .7rem;border-radius:2rem;font-size:.75rem;font-weight:600;white-space:nowrap}
.status-done{background:#dcfce7;color:#15803d}
.status-progress{background:#fef3c7;color:#b45309}
.status-draft{background:#f1f5f9;color:#64748b}
.status-error{background:#fee2e2;color:#dc2626}
.badge{background:#eff6ff;color:#1e40af;padding:.25rem .85rem;border-radius:2rem;font-size:.75rem;font-weight:600;display:inline-flex;align-items:center;gap:.3rem}

/* Loading */
.loading-spinner{text-align:center;padding:2rem;color:#64748b}
.case-grid .loading-spinner{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;justify-content:center}
.loading-page{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;margin:0 auto;gap:0}
.loading-container{max-width:640px;width:100%;padding:2rem 1.5rem;margin:0 auto}
.ready-page,.error-page{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;max-width:500px;margin:0 auto;text-align:center;gap:1rem}
.ready-page h2,.error-page h2{color:#1e293b}

/* New case */
.new-case-page{padding:2rem;min-height:100vh}
.new-case-container{max-width:700px;margin:0 auto}
.new-case-container h1{font-size:1.5rem;font-weight:700;margin-bottom:1.5rem}
.step-indicator{display:flex;align-items:center;margin-bottom:2rem}
.step-dot{height:32px;padding:0 .8rem;border-radius:2rem;font-size:.8rem;font-weight:600;background:#f1f5f9;color:#94a3b8;white-space:nowrap;transition:all .2s;display:inline-flex;align-items:center}
.step-dot.active{background:#3b82f6;color:white}
.step-dot.done{background:#dcfce7;color:#15803d}
.step-line{flex:1;height:2px;background:#e2e8f0;margin:0 .5rem}
.step-content{background:white;border-radius:1.5rem;padding:2rem;border:1px solid #e9eef3}
.step-panel h2{font-size:1.2rem;margin-bottom:1rem;font-weight:600}
.file-list{margin-top:.5rem}
.file-item{display:flex;align-items:center;gap:.75rem;padding:.5rem .75rem;background:#f8fafc;border-radius:.75rem;margin-bottom:.35rem;font-size:.9rem}
.file-item .file-name{flex:1;color:#1e293b}
.file-item .file-size{color:#94a3b8;font-size:.8rem}
.drop-zone.dragover{border-color:#3b82f6;background:#eff6ff}

/* Report */
.report-page{max-width:1200px;margin:0 auto;padding:1.5rem;height:100vh;box-sizing:border-box;overflow:hidden;display:flex;flex-direction:column}
.report-header{display:flex;justify-content:space-between;align-items:center;gap:.5rem;height:48px}
.report-header-title{font-size:.88rem;font-weight:600;color:#0f172a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;margin-left:.25rem}
.report-header-right{display:flex;align-items:center;gap:.5rem}

/* ============= Report: Left-Right Layout ============= */
.report-main{display:flex;gap:1.5rem;align-items:stretch;flex:1;min-height:0}

/* Left sidebar */
.report-left{width:320px;flex-shrink:0;display:flex;flex-direction:column;gap:1rem;max-height:100%;overflow:hidden}
.report-left .hero-card{padding:.85rem 1rem;margin-bottom:0}
.report-left .hero-card .hero-info{}
.hero-card-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem;padding-bottom:.35rem;border-bottom:1px solid rgba(255,255,255,.08);width:100%}
.hero-card-title{font-size:.78rem;font-weight:700;color:rgba(255,255,255,.5);text-transform:uppercase;letter-spacing:.04em;flex:1}
.hero-edit-btn{width:1.5rem;height:1.5rem;border-radius:50%;border:none;background:rgba(255,255,255,.1);color:rgba(255,255,255,.45);font-size:.6rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;flex-shrink:0}
.hero-edit-btn:hover{background:rgba(255,255,255,.2);color:white}
.hero-desc{font-size:.78rem;color:rgba(255,255,255,.8);line-height:1.5;margin-bottom:.6rem;padding-bottom:.5rem;border-bottom:1px solid rgba(255,255,255,.1)}
.hero-line{display:flex;align-items:baseline;gap:.5rem;padding:.12rem 0;font-size:.75rem}
.hero-label{flex-shrink:0;color:rgba(255,255,255,.45);min-width:3.2rem;font-size:.7rem}
.hero-value{color:rgba(255,255,255,.85);word-break:break-word}
.hero-line-dates .hero-value{font-size:.7rem;color:rgba(255,255,255,.5)}
.hero-line-dates .date-sep{color:rgba(255,255,255,.2);margin:0 .3rem}
.hero-empty-hint{font-size:.7rem;color:rgba(255,255,255,.5);line-height:1.5;padding:.35rem 0 0;display:flex;align-items:flex-start;gap:.35rem}
.hero-empty-hint i{font-size:.65rem;margin-top:.1rem;flex-shrink:0}
.hero-empty-hint .fa-pen{font-size:.6rem}

/* Right main content */
.report-right{flex:1;min-width:0;display:flex;flex-direction:column;max-height:100%}

/* Tab bar — right column tabs */
.report-tab-bar{display:flex;gap:0;margin-bottom:.75rem;height:48px;position:relative}
.report-tab-bar::after{content:'';position:absolute;bottom:0;left:0;right:0;height:1px;background:#e2e8f0}
.role-btn{flex:0 0 auto;height:48px;padding:0;border:none;background:transparent!important;font-size:.82rem;font-weight:500;cursor:pointer;color:#1e293b;display:inline-flex;align-items:center;gap:.25rem;white-space:nowrap;transition:all .12s;position:relative;margin-right:1.75rem}
.role-btn:last-child{margin-right:0}
.role-btn:hover{color:#1e293b}
.role-btn.active{color:#1e293b;font-weight:600;background:transparent!important}
.role-btn.active::after{content:'';position:absolute;bottom:0;left:0;right:0;height:2px;background:#3b82f6;border-radius:1px}

/* Tab panel — contains sidebar nav + content */
.report-tab-panel{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto}

/* Quick nav — horizontal row, sticky at top of tab panel */
.quick-nav{display:flex;gap:.25rem;flex-wrap:wrap;background:#f1f5f9;border-radius:.75rem;margin-bottom:1rem;align-items:center;position:sticky;top:.5rem;z-index:5}
.quick-nav-btn{display:flex;align-items:center;justify-content:center;gap:.35rem;flex:1;min-width:0;padding:.35rem .6rem;border:none;border-radius:.6rem;background:transparent;font-size:.75rem;font-weight:500;cursor:pointer;color:#64748b;transition:all .15s;white-space:nowrap;height:32px}
.quick-nav-btn:hover{color:#1e293b;background:rgba(255,255,255,.7)}
.quick-nav-btn.active{background:white;color:#1e293b;font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.06)}

/* Quick nav — action buttons separated by a vertical divider */
.quick-nav-divider{width:1px;height:1.25rem;background:#d1d5db;margin:0 .25rem;flex-shrink:0;align-self:center}
.quick-nav-actions{display:flex;gap:.3rem;margin-left:auto;flex-shrink:0}
.quick-nav-act{display:flex;align-items:center;gap:.35rem;padding:.35rem .7rem;border:1px solid #d1d5db;border-radius:.6rem;background:transparent;font-size:.75rem;font-weight:500;cursor:pointer;color:#475569;transition:all .15s;white-space:nowrap;height:32px}
.quick-nav-act:hover{background:white;border-color:#94a3b8;color:#1e293b}

/* Report content — layers inside tab panel */
.report-content{width:100%}
.report-content .card{scroll-margin-top:1rem;margin-bottom:.85rem}
.report-content .card:last-child{margin-bottom:0}

/* ============= File List ============= */
.file-list-section{background:white;border-radius:1rem;border:1px solid #e9eef3;overflow:hidden}
.file-list-header{display:flex;align-items:center;gap:.5rem;padding:.65rem 1rem;font-size:.82rem;font-weight:700;color:#0f172a;border-bottom:1px solid #f1f5f9}
.file-list-count{font-size:.7rem;color:#94a3b8;font-weight:400;margin-left:auto}
.file-header-actions{display:flex;align-items:center;gap:.15rem;margin-left:.35rem;flex-shrink:0}
.file-edit-toggle,.file-add-btn{width:1.5rem;height:1.5rem;border:none;border-radius:50%;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.62rem;transition:all .12s;flex-shrink:0;color:#475569}
.file-edit-toggle:hover,.file-add-btn:hover{background:#f1f5f9;color:#1e293b}
.file-edit-toggle.active{background:#eff6ff;color:#3b82f6}
.file-add-btn:disabled{opacity:.4;cursor:default}
.file-list-section{flex:1;min-height:0;display:flex;flex-direction:column}
.file-list-body{flex:1;overflow-y:auto;padding:.35rem 1rem}
.file-list-body::-webkit-scrollbar{width:4px}
.file-list-body::-webkit-scrollbar-thumb{background:#e2e8f0;border-radius:4px}
.file-item{display:flex;align-items:center;gap:.6rem;padding:.5rem .85rem;cursor:pointer;transition:background .1s;border-bottom:1px solid #f8fafc}
.file-show-more{justify-content:center;padding:.65rem .85rem}
.file-show-more:hover{background:#eff6ff}
.file-item:last-child{border-bottom:none}
.file-item:hover{background:#f1f5f9}
.file-item.selected{background:#eff6ff}
.file-edit-toggle{width:1.5rem;height:1.5rem;border:none;border-radius:50%;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.6rem;transition:all .12s;flex-shrink:0}
.file-edit-toggle:hover{background:#f1f5f9;color:#475569}
.file-edit-toggle.active{background:#eff6ff;color:#3b82f6}
.file-preview-btn{width:1.6rem;height:1.6rem;border:none;border-radius:.35rem;background:transparent;color:#94a3b8;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.7rem;transition:all .12s;flex-shrink:0}
.file-item:hover .file-preview-btn{color:#3b82f6;background:#eff6ff}
.file-del-btn{width:1.6rem;height:1.6rem;border:none;border-radius:.35rem;background:transparent;color:#dc2626;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.6rem;transition:all .12s;flex-shrink:0}
.file-del-btn:hover{background:#fef2f2;color:#dc2626}
.file-icon{width:1.75rem;height:1.75rem;border-radius:.35rem;display:flex;align-items:center;justify-content:center;font-size:.7rem;flex-shrink:0}
.file-icon.pdf{background:#fef2f2;color:#dc2626}
.file-icon.image{background:#f0fdf4;color:#16a34a}
.file-icon.doc{background:#eff6ff;color:#2563eb}
.file-icon.txt{background:#faf5ff;color:#7c3aed}
.file-icon.other{background:#f8fafc;color:#94a3b8}
.file-info{flex:1;min-width:0}
.file-name{font-size:.78rem;font-weight:500;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-meta{font-size:.68rem;color:#94a3b8}

/* ============= Preview Modal ============= */
.preview-overlay{position:fixed;inset:0;background:rgba(0,0,0,.85);z-index:9999;display:flex;flex-direction:column}
.preview-topbar{display:flex;align-items:center;gap:.35rem;padding:.5rem .75rem;background:rgba(0,0,0,.5);flex-shrink:0}
.preview-nav-btn{width:1.75rem;height:1.75rem;border-radius:50%;border:none;background:rgba(255,255,255,.08);color:rgba(255,255,255,.55);font-size:.7rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;flex-shrink:0}
.preview-nav-btn:hover:not(:disabled){background:rgba(255,255,255,.18);color:white}
.preview-nav-btn:disabled{opacity:.25;cursor:default}
.preview-filename{flex:1;color:rgba(255,255,255,.85);font-size:.82rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
.preview-position{font-size:.72rem;color:rgba(255,255,255,.45);flex-shrink:0;min-width:3rem;text-align:center}
.preview-close{width:1.75rem;height:1.75rem;border-radius:50%;border:none;background:rgba(255,255,255,.08);color:rgba(255,255,255,.55);font-size:.78rem;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s;flex-shrink:0}
.preview-close:hover{background:rgba(255,255,255,.18);color:white}
.preview-body{flex:1;min-height:0;display:flex;align-items:center;justify-content:center}
.preview-body iframe{width:100%;height:100%;border:none;border-radius:.5rem}
.preview-body img{max-width:100%;max-height:90vh;border-radius:.5rem;box-shadow:0 4px 24px rgba(0,0,0,.3)}
.preview-fallback{background:white;border-radius:1rem;padding:2.5rem;text-align:center;max-width:26rem}
.preview-fallback-icon{width:3.5rem;height:3.5rem;border-radius:50%;background:#f1f5f9;display:flex;align-items:center;justify-content:center;margin:0 auto 1rem}
.preview-fallback-icon i{font-size:1.5rem;color:#94a3b8}
.preview-fallback h3{font-size:.95rem;font-weight:600;color:#0f172a;margin-bottom:.25rem}
.preview-fallback p{font-size:.82rem;color:#94a3b8;margin-bottom:1.5rem}
.preview-fallback .btn-primary{display:inline-flex;align-items:center;gap:.4rem}

/* AI Assistant Chat */
.chat-load-more-wrap{text-align:center;padding:0 .25rem .35rem;flex-shrink:0}
.chat-load-more{display:inline-flex;align-items:center;gap:.3rem;padding:.25rem .75rem;font-size:.75rem;color:#3b82f6;background:#eff6ff;border:1px solid #bfdbfe;border-radius:2rem;cursor:pointer;transition:all .15s;font-weight:500}
.chat-load-more:hover{background:#dbeafe;color:#2563eb}
.chat-empty{flex:1}
.chat-container{display:flex;flex-direction:column;flex:1;min-height:0;background:white;border-radius:1.25rem;border:1px solid #e9eef3;padding:1rem}
.chat-messages{flex:1;overflow-y:auto;padding:.5rem .25rem}
.chat-messages::-webkit-scrollbar{width:4px}
.chat-messages::-webkit-scrollbar-thumb{background:#e2e8f0;border-radius:4px}
.chat-msg{display:flex;margin-bottom:.6rem}
.chat-msg-user{justify-content:flex-end}
.chat-msg-ai{justify-content:flex-start}
.chat-msg-bubble{max-width:80%;padding:.55rem .8rem;border-radius:.85rem;font-size:.82rem;line-height:1.4;word-break:break-word}
.chat-msg-user .chat-msg-bubble{background:#3b82f6;color:white;border-bottom-right-radius:.25rem;white-space:pre-wrap}
.chat-msg-ai .chat-msg-bubble{background:#f1f5f9;color:#1e293b;border-bottom-left-radius:.25rem;white-space:normal}
.chat-msg-ai .chat-msg-bubble p{margin:0;white-space:normal}
.chat-msg-ai .chat-msg-bubble .chat-text{white-space:normal}
.chat-msg-ai .chat-msg-bubble .chat-text p{margin:.3em 0;white-space:normal;line-height:1.5}
.chat-msg-ai .chat-msg-bubble .chat-text p:first-child{margin-top:0}
.chat-msg-ai .chat-msg-bubble .chat-text p:last-child{margin-bottom:0}
.chat-msg-ai .chat-msg-bubble ul,.chat-msg-ai .chat-msg-bubble ol{margin:.12em 0;padding-left:1.2em}
.chat-msg-ai .chat-msg-bubble li{margin:.06em 0}
.chat-msg-ai .chat-msg-bubble hr{border:none;border-top:1px solid #d1d9e6;margin:.5em 0}
.chat-msg-ai .chat-msg-bubble strong{color:#0f172a;font-weight:600}
.chat-input-bar{display:flex;align-items:flex-end;gap:.5rem;padding:.6rem 0 0}
.chat-input{flex:1;padding:.5rem .65rem;border:1px solid #d1d5db;border-radius:.65rem;font-size:.82rem;outline:none;resize:none;font-family:inherit;line-height:1.4;max-height:100px;transition:border-color .15s}
.chat-input:focus{border-color:#3b82f6}
.chat-send-btn{width:2.2rem;height:2.2rem;border:none;border-radius:50%;background:#3b82f6;color:white;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.82rem;transition:all .15s;flex-shrink:0}
.chat-send-btn:hover{background:#2563eb}
.chat-send-btn:disabled{opacity:.5;cursor:default}
.chat-loading .chat-msg-bubble{background:#f1f5f9;color:#94a3b8;font-style:italic}
.chat-file-ref-btn{display:inline-flex;align-items:center;gap:.35rem;padding:.2rem .55rem;margin:.1rem .15rem;font-size:.78rem;font-weight:500;color:#1d4ed8;background:#eef2ff;border:1px solid #c7d2fe;border-radius:.35rem;cursor:pointer;transition:all .12s;white-space:nowrap;vertical-align:baseline;font-family:inherit}
.chat-file-ref-btn:hover{background:#dbeafe;color:#1e40af;border-color:#a5b4fc}
.chat-file-ref-btn i{font-size:.72rem;color:#6366f1}
.chat-toolbar{display:flex;align-items:center;justify-content:space-between;padding:0 0 .5rem;margin-bottom:.5rem;border-bottom:1px solid #eef2f8}
.chat-toolbar-title{font-size:.9rem;font-weight:600;color:#0f172a;display:flex;align-items:center;gap:.4rem}
.chat-toolbar-title i{color:#0ea5e9;font-size:.85rem}
.chat-toolbar-actions{display:flex;gap:.4rem}
.chat-toolbar-btn{display:inline-flex;align-items:center;gap:.3rem;padding:.25rem .65rem;font-size:.78rem;border-radius:.35rem;border:1px solid #e2e8f0;background:#fff;color:#64748b;cursor:pointer;transition:all .15s;font-family:inherit}
.chat-toolbar-btn:hover{background:#fef2f2;border-color:#fecaca;color:#dc2626}

@media(max-width:900px){
  .report-page{height:auto;overflow:visible}
  .report-main{flex-direction:column}
  .report-left{width:100%;position:static;max-height:none}
  .report-right{width:100%;min-width:0}
  .quick-nav-btn{font-size:.7rem;padding:.3rem .4rem}
}

/* Progress animations */
@keyframes shimmer{
    0%{background-position:200% 0}
    100%{background-position:-200% 0}
}
@keyframes breathe{
    0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,.18)}
    50%{box-shadow:0 0 0 5px rgba(59,130,246,.25)}
}
@keyframes dot-pulse{
    0%,40%{opacity:.2;transform:scale(.8)}
    80%,100%{opacity:1;transform:scale(1)}
}

/* .progress-card-current{animation:breathe 1.5s ease-in-out infinite} */
.substep-dot{display:inline-block;width:6px;height:6px;border-radius:50%;margin:0 2px;transition:all .3s}
.substep-dot.active{opacity:1;transform:scale(1)}
.substep-dot.inactive{opacity:.2;transform:scale(.8)}
.substep-current .substep-dot{animation:dot-pulse 1.2s ease-in-out infinite}
.substep-current .substep-dot:nth-child(1){animation-delay:0s}
.substep-current .substep-dot:nth-child(2){animation-delay:.3s}
.substep-current .substep-dot:nth-child(3){animation-delay:.6s}

/* Card */
.card{background:white;border-radius:1.25rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.05);margin-bottom:1.25rem;border:1px solid #e9eef3}
.card-header{padding:1rem 1.5rem;border-bottom:1px solid #eef2f8;display:flex;align-items:center;gap:.6rem;position:relative}
.card-title{font-weight:700;font-size:1.1rem;display:flex;align-items:center;gap:.5rem;color:#1e293b;flex:1}
.card-title i{color:#3b82f6;font-size:1rem}
.card-body{padding:1.25rem 1.5rem}
/* Layer reload button in card headers */
.layer-reload-btn{background:transparent;border:none;color:#94a3b8;font-size:.85rem;cursor:pointer;padding:.3rem;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0;margin-left:auto;width:28px;height:28px}
.layer-reload-btn:hover{color:#3b82f6;background:#eff6ff}
.layer-reload-btn:disabled{opacity:.4;cursor:not-allowed;color:#94a3b8;background:transparent}
.layer-reload-btn.is-reloading{border-radius:2rem;padding:0 .65rem;cursor:default;width:auto}
.layer-loading{text-align:center;padding:2rem;color:#64748b;font-size:.9rem}
.layer-loading i{margin-right:.5rem}
.layer-reloading-badge{font-size:.75rem;color:#64748b;margin-left:.5rem;white-space:nowrap;animation:pulse 1.5s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.report-section{margin-bottom:1rem}
.report-section h4{font-weight:600;font-size:.95rem;color:#1e293b;margin-bottom:.3rem}
.report-section p{font-size:.9rem;color:#334155;line-height:1.6}
.report-section ul{list-style:none;padding:0}
.report-section ul li{padding:.3rem 0;font-size:.9rem;color:#334155;border-bottom:1px solid #f1f5f9}
.report-section ul li:before{content:"• ";color:#3b82f6;font-weight:700}

.error-msg{background:#fee2e2;border-radius:.75rem;padding:.75rem 1rem;color:#dc2626;font-size:.9rem}

/* Settings */
.settings-page{max-width:1000px;margin:0 auto;padding:1.5rem}
.settings-header{display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem}
.settings-header h1{font-size:1.3rem;font-weight:700}
.settings-layout{display:flex;gap:1.5rem}
.settings-nav{width:200px;flex-shrink:0;background:white;border-radius:1.25rem;padding:.5rem;border:1px solid #e9eef3}
.settings-nav-btn{display:block;width:100%;padding:.6rem .8rem;border:none;border-radius:.75rem;background:transparent;font-size:.88rem;font-weight:500;cursor:pointer;text-align:left;color:#64748b;transition:all .2s;margin-bottom:.2rem}
.settings-nav-btn:hover{background:#f1f5f9;color:#1e293b}
.settings-nav-btn.active{background:#eff6ff;color:#1e40af;font-weight:600}
.settings-content{flex:1}
.settings-card{background:white;border-radius:1.25rem;padding:1.5rem;border:1px solid #e9eef3}
.settings-card h2{font-size:1.15rem;font-weight:600;margin-bottom:1rem}

/* Avatar settings */
.avatar-preview{position:relative;width:120px;height:120px;border-radius:50%;margin:0 auto 1rem;overflow:hidden;background:#f1f5f9;display:flex;align-items:center;justify-content:center;border:3px solid #e2e8f0;cursor:pointer}
.avatar-preview img{width:100%;height:100%;object-fit:cover}
.avatar-preview .avatar-fallback{font-size:2.5rem;font-weight:700;color:#94a3b8}
.avatar-img{width:100%;height:100%;object-fit:cover}
.avatar-preview-hover{position:absolute;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;color:white;font-size:.85rem;font-weight:600;opacity:0;transition:opacity .2s}
.avatar-preview:hover .avatar-preview-hover{opacity:1}
.avatar-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.65rem}
.avatar-option{border:2px solid #e2e8f0;border-radius:.75rem;padding:.35rem;cursor:pointer;transition:all .12s;text-align:center}
.avatar-option:hover{border-color:#93c5fd}
.avatar-option.active{border-color:#3b82f6;background:#eff6ff}
.avatar-option img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:.35rem;display:block}
.readonly-field{background:#f8fafc;color:#64748b;cursor:default;width:100%;padding:.7rem 1rem;border:1px solid #e2e8f0;border-radius:.75rem;font-size:.95rem;display:flex;align-items:center;gap:.5rem}
.readonly-field i{color:#94a3b8;font-size:.85rem}
@media(max-width:700px){.settings-layout{flex-direction:column}.settings-nav{width:100%;display:flex;gap:.3rem;overflow-x:auto}}

/* Prompts editor */
.prompt-role-tabs{display:flex;gap:.35rem;margin-bottom:.75rem}
.prompt-role-btn,.prompt-layer-btn{height:32px;padding:0 .8rem;border:none;border-radius:2rem;background:#f1f5f9;font-size:.82rem;font-weight:500;cursor:pointer;color:#64748b;transition:all .2s;display:inline-flex;align-items:center}
.prompt-role-btn.active,.prompt-layer-btn.active{background:#3b82f6;color:white}
.prompt-layer-tabs{display:flex;gap:.35rem;margin-bottom:.75rem;flex-wrap:wrap}

/* Modal */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;z-index:1000;padding:1rem}
.modal{background:white;border-radius:1.5rem;max-width:560px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 25px 60px rgba(0,0,0,.15)}
.modal-header{display:flex;justify-content:space-between;align-items:center;padding:1.25rem 1.5rem;border-bottom:1px solid #eef2f8}
.modal-header h2{font-size:1.15rem;font-weight:600}
.modal-close{background:none;border:none;font-size:1.5rem;cursor:pointer;color:#94a3b8;padding:.2rem;line-height:1}
.modal-close:hover{color:#1e293b}
.modal-body{padding:1.5rem}
.modal-confirm{max-width:420px}
.modal-body-center{text-align:center}
.modal-desc{margin-bottom:1.25rem;color:#475569}
.modal-desc-secondary{margin-bottom:1.5rem;color:#64748b;font-size:.9rem}
.modal-actions{display:flex;gap:.75rem;justify-content:center}
.modal-icon{color:#3b82f6}
.file-list-header{font-weight:600;font-size:.9rem;color:#1e293b;margin-bottom:.5rem}
.file-list-panel{background:#f8fafc;border-radius:.75rem;padding:.75rem;margin-top:.75rem;border:1px solid #eef2f8}
.file-list-panel .file-item{background:white;border-radius:.5rem;padding:.5rem .75rem;margin-bottom:.35rem;border:1px solid #eef2f8}
.file-list-panel .file-item:last-child{margin-bottom:0}
.progress-steps{display:flex;flex-direction:column;gap:.75rem;padding:0}
.progress-step{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background:#f8fafc;border-radius:.75rem;border:1px solid #eef2f8}
.progress-icon{width:1.5rem;text-align:center;font-size:1rem}
.progress-label{font-size:.9rem;color:#64748b}
.upload-panel .drop-zone{cursor:pointer;transition:all .2s;background:#f8fafc;border-radius:1rem;padding:2rem 1.5rem;text-align:center}
.upload-panel .drop-zone:hover{border-color:#3b82f6!important;background:#eff6ff!important}
.upload-panel .drop-zone.dragover{border-color:#2563eb!important;background:#dbeafe!important;transform:scale(1.01)}
.upload-panel .drop-zone i{font-size:2.5rem;color:#3b82f6;margin-bottom:.6rem;display:block}
.upload-panel .drop-zone p{color:#1e293b;font-size:.95rem;margin-bottom:.3rem}
.upload-panel .drop-zone small{color:#94a3b8;font-size:.8rem}
.upload-panel .btn-primary{border-top:1px solid #eef2f8;margin-top:.5rem!important}

/* Misc */
pre{background:#f8fafc;padding:.75rem;border-radius:.75rem;border:1px solid #e2e8f0;overflow-x:auto}
@media(max-width:600px){.case-grid{grid-template-columns:1fr}}

/* ============= Report: Hero Header ============= */
.hero-card{background:linear-gradient(135deg,#0f2b3d,#1e3a5f);color:white;border:none;border-radius:1.25rem;padding:1.75rem 2rem;display:flex;justify-content:space-between;flex-wrap:wrap;align-items:center;gap:1rem;margin-bottom:.75rem}
.hero-badge{background:rgba(255,255,255,.15);color:white;padding:.2rem .85rem;border-radius:2rem;font-size:.75rem;font-weight:600;display:inline-block}
/* Hero info single-line layout (left sidebar) */


/* ============= Report: Timeline ============= */
.timeline-item{display:flex;gap:1rem;margin-bottom:1rem;border-left:2px solid #e2e8f0;padding-left:1.2rem;position:relative}
.timeline-time{font-weight:700;min-width:90px;color:#2563eb;flex-shrink:0}
.timeline-desc{color:#334155;font-size:.9rem}

/* ============= Report: Conflict / Attack Points ============= */
.conflict{background:#fee2e2;border-left:4px solid #ef4444;padding:.3rem .8rem;border-radius:12px;font-size:.85rem;margin-top:.25rem;display:inline-block}
.attack-point{background:#fff1f0;border-left:3px solid #dc2626;padding:.75rem;border-radius:12px;margin-top:.75rem;font-size:.9rem;line-height:1.6}
.attack-point strong{color:#1e293b}

/* ============= Report: Evidence Tags ============= */
.evidence-tag{display:inline-block;background:#f1f5f9;border-radius:1rem;padding:.2rem .7rem;font-size:.75rem;font-weight:500;margin-right:.5rem;margin-bottom:.5rem;white-space:nowrap}
.prob-high{background:#dcfce7;color:#15803d}
.prob-mid{background:#fff3e3;color:#b45309}

/* ============= Report: Progress Bar ============= */
.progress-bar{height:6px;background:#e2e8f0;border-radius:10px;overflow:hidden;width:100%}
.progress-fill{height:100%;border-radius:10px;background:#3b82f6;width:0%;transition:width .5s ease}
.progress-bar-animate .progress-fill{background:linear-gradient(90deg,#3b82f6,#60a5fa,#3b82f6);background-size:200% 100%;animation:shimmer 2s ease-in-out infinite}

/* ============= Report: Risk Dashboard ============= */
.risk-grid{display:flex;flex-wrap:wrap;gap:1rem}
.risk-card{flex:1;min-width:180px;background:#fef9e3;border-radius:1rem;padding:.8rem 1rem;border-left:5px solid #f59e0b;font-size:.85rem;line-height:1.5}
.risk-high{background:#fee2e2;border-left-color:#dc2626}
.risk-mid{background:#fff3e3;border-left-color:#f97316}

/* ============= Report: Strategy Table ============= */
.strategy-table{width:100%;border-collapse:collapse;font-size:.88rem}
.strategy-table th,.strategy-table td{padding:.65rem .75rem;text-align:left;border-bottom:1px solid #eef2f8}
.strategy-table th{font-weight:600;color:#475569;background:#f8fafc;font-size:.82rem}
.strategy-table tr:hover{background:#f8fafc}
.recommend{background:#eef2ff;border-radius:20px;padding:.2rem .8rem;font-weight:600;font-size:.75rem;display:inline-block;color:#4f46e5}

/* ============= Report: Grid 2/3 ============= */
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:1.25rem}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:1.25rem}
@media(max-width:900px){.grid-2,.grid-3,.progress-grid{grid-template-columns:1fr}}
.progress-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem}

/* ============= Report: Defense Pair ============= */
.defense-pair{display:flex;gap:.75rem;margin-bottom:.65rem;flex-wrap:wrap}
.defense-attack,.defense-response{flex:1;min-width:200px;border-left:3px solid;border-radius:.75rem;padding:.7rem .85rem;font-size:.88rem;line-height:1.6}
.defense-label{font-weight:700;font-size:.8rem;margin-bottom:.25rem;text-transform:uppercase;letter-spacing:.02em}
.defense-content{color:#334155;white-space:pre-wrap}
@media(max-width:600px){.defense-pair{flex-direction:column}}

/* ============= Report: Misc ============= */
.report-content .card .card-header{padding:.85rem 1.25rem}
.report-content .card .card-body{padding:1.1rem 1.25rem}

/* ============= Print / PDF ============= */
@media print {
  body{background:white}
  .report-header-right,.report-tab-bar,.file-list-section,.file-list-header,.file-item,
  .quick-nav,.ai-footer,#rpQuickNav{display:none!important}
  .report-page{padding:0;max-width:100%}
  .report-main{display:block}
  .report-left{width:100%;position:static;margin-bottom:1rem}
  .report-right{width:100%}
  .report-content .card{break-inside:avoid;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:1rem}
  .report-content .card .card-body{padding:.8rem 1rem}
  .hero-card{background:linear-gradient(135deg,#0f2b3d,#1e3a5f)!important;color:white!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact;padding:1.25rem 1.5rem;border-radius:8px}
  .hero-card *{color:white!important}
  .evidence-tag{background:#eff6ff!important;color:#1d4ed8!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact}
  .evidence-tag.prob-high{background:#fef2f2!important;color:#991b1b!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact}
  .evidence-tag.prob-mid{background:#fffbeb!important;color:#92400e!important;
    -webkit-print-color-adjust:exact;print-color-adjust:exact}
  .strategy-table th{background:#f1f5f9!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .strategy-table td,.strategy-table th{border:1px solid #e2e8f0;padding:.4rem .6rem;font-size:.85rem}
  .timeline-item,.attack-point{break-inside:avoid}
  .progress-card-current{animation:none!important}
  .status-badge,.card-header i{color:#3b82f6!important}
}

/* ============= Mobile Responsive ============= */
@media(max-width:400px){.dashboard{padding:1rem}.case-card{padding:1rem}}

/* Dashboard toolbar — stack on very narrow */
@media(max-width:480px){
  .dash-toolbar{flex-direction:column}
  .search-input{width:100%}
  .dash-filters{width:100%;justify-content:stretch}
  .filter-select{flex:1;min-width:0;font-size:.78rem;padding:.4rem 1.6rem .4rem .7rem}
}
/* Dashboard header — stack buttons */
@media(max-width:400px){
  .dash-header-right{flex-direction:column;align-items:stretch;width:100%}
  .dash-header-right .btn-primary{width:100%;justify-content:center;padding:.6rem 1rem}
  .user-dropdown{align-self:flex-end}
}

/* Narrow report */
@media(max-width:600px){
  .report-page{padding:.75rem}
  .report-main{gap:1rem}
  .hero-card{padding:.75rem}
  .report-tab-bar{padding:.3rem;gap:.15rem}
  .role-btn{font-size:.75rem;padding:0 .5rem;height:28px}
  .quick-nav-btn{font-size:.68rem;padding:.2rem .35rem;gap:.2rem}
  .quick-nav{gap:.15rem;margin-bottom:.65rem}
  .quick-nav-act{font-size:.7rem;padding:.25rem .5rem}
  .quick-nav-divider{margin:0 .1rem}
  .report-content .card .card-body{padding:.6rem .75rem}
  .report-content .card .card-header{padding:.5rem .75rem}
  .card-title{font-size:.88rem}
  .card-title i{font-size:.78rem}
  .strategy-table{display:block;overflow-x:auto;white-space:nowrap}
  .risk-grid{gap:.5rem}
  .risk-card{min-width:140px;padding:.6rem .75rem;font-size:.8rem}
}



/* Loading */
@media(max-width:480px){.loading-container{padding:1.5rem 1rem}.loading-page h2{font-size:1.15rem!important}}

/* Risk cards full width */
@media(max-width:480px){.risk-card{min-width:0;width:100%}}

/* Modal compact */
@media(max-width:480px){.modal-body{padding:1rem}.modal-header{padding:1rem 1.25rem}}

/* Attack points compact */
@media(max-width:480px){.attack-point{padding:.55rem .7rem}}

/* Timeline compact */
@media(max-width:480px){.timeline-item{gap:.5rem}.timeline-time{min-width:65px;font-size:.82rem}.timeline-desc{font-size:.82rem}}

/* Evidence tags compact */
@media(max-width:480px){.evidence-tag{font-size:.7rem;margin-right:.3rem;margin-bottom:.3rem;padding:.15rem .55rem}}

/* Progress grid */
@media(max-width:480px){.progress-grid{grid-template-columns:1fr}}

/* Admin iframe */
.admin-iframe-container{position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;background:#f1f5f9}
.admin-iframe{width:100%;height:100%;border:none}

/* Dashboard empty state (no cases yet) */
.dashboard-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;color:#94a3b8;text-align:center}
.dashboard-empty i{font-size:2.5rem;margin-bottom:.75rem}
.dashboard-empty p{font-size:.95rem}

/* ===== Empty State Component (shared across tabs) ===== */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:320px;padding:3rem 1.5rem;text-align:center}
.empty-state-icon{width:4.2rem;height:4.2rem;border-radius:1.1rem;display:flex;align-items:center;justify-content:center;margin-bottom:1rem}
.empty-state-icon i{font-size:2.2rem;color:#2563eb}
.empty-state-icon--primary,
.empty-state-icon--muted,
.empty-state-icon--danger{background:#e2e8f0}
.empty-state-title{font-size:1rem;font-weight:700;color:#1e293b;margin-bottom:.5rem}
.empty-state-desc{font-size:.82rem;color:#94a3b8;max-width:380px;line-height:1.45;margin-bottom:1.25rem}
.empty-state-title--danger{color:#dc2626}
.empty-state .btn-primary{padding:0 1.5rem;height:36px}

.graph-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:320px;padding:2.5rem;text-align:center}
.graph-loading-spinner{width:4.2rem;height:4.2rem;border-radius:1.1rem;background:#e2e8f0;display:flex;align-items:center;justify-content:center;margin-bottom:1rem}
.graph-loading-spinner i{font-size:2.2rem;color:#2563eb}
.graph-loading-title{font-size:.95rem;font-weight:600;color:#1e293b;margin-bottom:.35rem}
.graph-loading-desc{font-size:.8rem;color:#94a3b8;line-height:1.4}

.graph-container-wrapper{background:#fff;border:1px solid #e9eef3;border-radius:1.25rem;padding:1rem}
.graph-stale-banner{display:flex;align-items:center;gap:.4rem;padding:.5rem .7rem;margin-bottom:.5rem;border-radius:.35rem;background:#fffbeb;border:1px solid #fde68a;font-size:.78rem;color:#92400e}
.graph-stale-banner i{color:#f59e0b;font-size:.85rem}
.graph-stale-banner a{color:#2563eb;text-decoration:underline;margin-left:.15rem;cursor:pointer}

.graph-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:.5rem}
.graph-title{font-size:.9rem;font-weight:700;color:#1e293b}
.graph-title i{color:#3b82f6;margin-right:.35rem}
.graph-toolbar-actions{display:flex;gap:.4rem}
.graph-toolbar-btn{display:inline-flex;align-items:center;gap:.3rem;padding:.25rem .65rem;font-size:.78rem;border-radius:.35rem;border:1px solid #e2e8f0;background:#fff;color:#475569;cursor:pointer;transition:all .15s;font-family:inherit}
.graph-toolbar-btn:hover{background:#f1f5f9;border-color:#cbd5e1}

.graph-legend{display:flex;flex-wrap:wrap;gap:.5rem;padding:.45rem .65rem;margin-bottom:.4rem;background:#f8fafc;border-radius:.35rem;border:1px solid #e2e8f0}
.graph-legend-item{display:inline-flex;align-items:center;gap:.3rem;font-size:.75rem;color:#475569}
.graph-legend-dot{width:.55rem;height:.55rem;border-radius:50%;display:inline-block;flex-shrink:0}

.graph-canvas-container{width:100%;height:520px;border:1px solid #e2e8f0;border-radius:.35rem;background:#fcfcfc;overflow:hidden;position:relative}
.graph-canvas-container canvas{display:block}

.graph-footer{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.45rem 0;font-size:.78rem;color:#94a3b8}
.graph-stat{display:inline-flex;align-items:center;gap:.25rem}
.graph-stat strong{color:#475569;font-weight:600}
.graph-stat-sep{color:#e2e8f0}

.graph-empty-sub{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:#94a3b8}
.graph-empty-sub i{font-size:2rem;margin-bottom:.5rem}
.graph-empty-sub p{font-size:.85rem;margin:0}

/* Graph custom tooltip (event-driven, not relying on vis title property) */
.graph-custom-tooltip{position:absolute;z-index:9999;background:#fff;border:1px solid #e2e8f0;border-radius:.6rem;padding:.6rem .85rem;box-shadow:0 4px 16px rgba(0,0,0,.1);font-size:.78rem;line-height:1.5;max-width:300px;word-break:break-word;pointer-events:none;display:none}
.graph-custom-tooltip .tooltip-name{font-size:.9rem;font-weight:700;color:#0f172a;margin-bottom:.1rem}
.graph-custom-tooltip .tooltip-role{display:inline-block;font-size:.65rem;font-weight:600;color:#4f46e5;background:#eef2ff;padding:.04rem .45rem;border-radius:1rem;margin-bottom:.25rem}
.graph-custom-tooltip .tooltip-aliases{font-size:.72rem;color:#64748b;margin-bottom:.15rem}
.graph-custom-tooltip .tooltip-detail{font-size:.75rem;color:#334155;margin-top:.2rem;border-top:1px solid #e9eef3;padding-top:.25rem}
.graph-custom-tooltip .tooltip-detail-empty{color:#94a3b8;font-style:italic}
.graph-custom-tooltip .tooltip-edge-label{font-size:.82rem;font-weight:600;color:#0f172a}
.graph-custom-tooltip .tooltip-edge-evidence{font-size:.72rem;color:#64748b;margin-top:.1rem}
.graph-custom-tooltip .tooltip-edge-evidence em{color:#94a3b8}

/* ==================== Case Timeline ==================== */

/* (empty-state classes inherited from shared component above) */
.timeline-empty-sub{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem 1rem;text-align:center;color:#94a3b8}
.timeline-empty-sub i{font-size:2rem;margin-bottom:.5rem;color:#cbd5e1}
.timeline-empty-sub p{font-size:.85rem;margin:0}

.timeline-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:320px;text-align:center;padding:2.5rem}
.timeline-loading-spinner{width:4.2rem;height:4.2rem;border-radius:1.1rem;background:#e2e8f0;display:flex;align-items:center;justify-content:center;margin-bottom:1rem}
.timeline-loading-spinner i{font-size:2.2rem;color:#2563eb}
.timeline-loading-title{font-size:.95rem;font-weight:600;color:#64748b;margin-bottom:.3rem}
.timeline-loading-desc{font-size:.8rem;color:#94a3b8}

.timeline-wrapper{background:#fff;border:1px solid #e9eef3;border-radius:1.25rem;padding:1rem}
.timeline-stale-banner{padding:.5rem .75rem;background:#fef9c3;border:1px solid #facc15;border-radius:.5rem;font-size:.78rem;color:#854d0e;margin-bottom:.65rem}
.timeline-stale-banner a{color:#ca8a04;font-weight:600;text-decoration:underline;cursor:pointer}

.timeline-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:.5rem}
.timeline-title{font-size:.9rem;font-weight:600;color:#1e293b}
.timeline-title i{color:#3b82f6;margin-right:.35rem}
.timeline-toolbar-actions{display:flex;gap:.4rem}
.timeline-toolbar-btn{background:transparent;border:1px solid #e2e8f0;border-radius:.35rem;padding:.25rem .65rem;font-size:.78rem;color:#64748b;cursor:pointer;display:flex;align-items:center;gap:.3rem}
.timeline-toolbar-btn:hover{background:#f8fafc;border-color:#cbd5e1;color:#1e293b}

.timeline-container{padding:0}
.timeline-vertical{position:relative;padding-left:1.5rem}
.timeline-vertical::before{content:'';position:absolute;left:.85rem;top:.4rem;bottom:.4rem;width:2px;background:#e2e8f0}

.timeline-event{position:relative;padding-bottom:0}
.timeline-event:last-child{padding-bottom:0}
.timeline-event-dot{position:absolute;left:-1.5rem;top:.5rem;width:.7rem;height:.7rem;border-radius:50%;background:#3b82f6;border:2px solid #fff;box-shadow:0 0 0 2px #93c5fd;z-index:1}
.timeline-event-dot-first{background:#1d4ed8;box-shadow:0 0 0 2px #60a5fa}
.timeline-event-dot-last{background:#f59e0b;box-shadow:0 0 0 2px #fcd34d}
.timeline-event-line{display:none}

.timeline-event-card{background:#fff;border:1px solid #e2e8f0;border-radius:.5rem;padding:.65rem .8rem;margin-bottom:.65rem;transition:box-shadow .15s}
.timeline-event-card:hover{box-shadow:0 2px 8px rgba(0,0,0,.06);border-color:#cbd5e1}
.timeline-event-header{display:flex;align-items:center;gap:.4rem;margin-bottom:.2rem}
.timeline-event-date{font-size:.75rem;font-weight:600;color:#3b82f6}
.timeline-precision-badge{font-size:.6rem;padding:.08rem .35rem;border-radius:.25rem;background:#eff6ff;color:#60a5fa;border:1px solid #bfdbfe}
.timeline-event-title{font-size:.85rem;font-weight:600;color:#1e293b;margin-bottom:.2rem}
.timeline-event-desc{font-size:.78rem;color:#64748b;line-height:1.5;margin-bottom:.25rem}
.timeline-event-parts{font-size:.72rem;color:#64748b;margin-bottom:.2rem}
.timeline-event-parts i{font-size:.65rem;margin-right:.2rem;color:#94a3b8}
.timeline-event-part{display:inline-block;background:#f1f5f9;padding:.05rem .45rem;border-radius:.25rem;margin-right:.2rem;color:#475569}
.timeline-event-files{margin-top:.15rem}
.timeline-file-hint{display:inline-block;font-size:.65rem;color:#8b5cf6;background:#faf5ff;padding:.08rem .4rem;border-radius:.25rem;margin-right:.25rem;margin-bottom:.15rem;border:1px solid #e9d5ff;cursor:default}
.timeline-file-hint i{font-size:.6rem;margin-right:.15rem}
.timeline-file-btn{display:inline-flex;align-items:center;gap:.25rem;font-size:.65rem;font-weight:500;color:#1d4ed8;background:#eef2ff;border:1px solid #c7d2fe;padding:.08rem .4rem;border-radius:.25rem;margin-right:.25rem;margin-bottom:.15rem;cursor:pointer;transition:all .12s;font-family:inherit}
.timeline-file-btn:hover{background:#dbeafe;color:#1e40af;border-color:#a5b4fc}
.timeline-file-btn i{font-size:.6rem;color:#6366f1}

.timeline-footer{padding:.5rem;text-align:center;font-size:.75rem;color:#94a3b8;border-top:1px solid #f1f5f9;margin-top:.25rem}
.timeline-footer .timeline-stat i{margin-right:.2rem}

/* vis-timeline canvas container */
.timeline-canvas-container{width:100%;height:520px;border:1px solid #e2e8f0;border-radius:.35rem;background:#fcfcfc;overflow:hidden}
.timeline-canvas-container .vis-timeline{font-family:inherit;border:none}
.timeline-canvas-container .vis-item{background:#fff;border:1px solid #e2e8f0;border-radius:.3rem;cursor:pointer}
.timeline-canvas-container .vis-item.vis-selected{background:#eff6ff;border-color:#3b82f6}
.timeline-canvas-container .vis-item.vis-hover{background:#f8fafc}
.timeline-canvas-container .vis-item-content{padding:.2rem .5rem;overflow:hidden}
/* vis-timeline items */
.tl-item{font-size:.78rem;line-height:1.3}
.tl-item-title{font-weight:600;color:#1e293b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tl-item-date{font-size:.68rem;color:#64748b;margin-top:.05rem}
.tl-item-badge{display:inline-block;font-size:.6rem;padding:.02rem .3rem;border-radius:.2rem;background:#eff6ff;color:#3b82f6;margin-left:.2rem}
/* vis-timeline tooltip */
.tl-tooltip{font-size:.78rem;line-height:1.5;max-width:320px;word-break:break-word}
.tl-tooltip strong{color:#1e293b;font-size:.85rem}
.tl-tooltip p{margin:.3rem 0 0}
/* precision color coding for timeline items */
.tl-precision-day{border-left:3px solid #3b82f6}
.tl-precision-month{border-left:3px solid #8b5cf6}
.tl-precision-quarter{border-left:3px solid #f59e0b}
.tl-precision-year{border-left:3px solid #f97316}
.tl-precision-inferred{border-left:3px solid #94a3b8;opacity:.85}
