.chat-ref-chips{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:5px;margin-bottom:6px;max-width:85%}.chat-ref-chips.expanded{flex-wrap:wrap;justify-content:flex-start}.message.sent .chat-ref-chips.expanded{justify-content:flex-end}.chat-ref-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px 4px 8px;border-radius:999px;font-size:12.5px;font-weight:500;background:var(--accent-soft, rgba(0, 112, 243, .1));color:var(--text-main);cursor:pointer;border:1px solid transparent;transition:border-color .15s ease,box-shadow .15s ease,transform .1s ease;white-space:nowrap;max-width:200px;overflow:hidden;line-height:1.35;flex-shrink:0}.chat-ref-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-ref-overflow{display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;background:#0000000f;color:var(--text-muted);white-space:nowrap;flex-shrink:0;cursor:pointer;letter-spacing:.01em;transition:background .15s ease}.chat-ref-overflow:hover{background:#0000001a}body.dark-mode .chat-ref-overflow{background:#ffffff14;color:var(--text-light)}body.dark-mode .chat-ref-overflow:hover{background:#ffffff24}.chat-ref-chips-hidden{display:none}.chat-ref-chip-value{font-size:10.5px;font-weight:600;color:#22c55e;margin-left:2px;flex-shrink:0}.chat-ref-chip:hover{box-shadow:0 2px 6px #0000000f;transform:translateY(-1px)}.chat-ref-chip[data-ref-type=task]:hover{border-color:#0070f340}.chat-ref-chip[data-ref-type=event]:hover{border-color:#8e44e640}.chat-ref-chip[data-ref-type=customer]:hover{border-color:#e67e2240}body.dark-mode .chat-ref-chip:hover{box-shadow:0 2px 6px #0003}body.dark-mode .chat-ref-chip[data-ref-type=task]:hover{border-color:#0070f359}body.dark-mode .chat-ref-chip[data-ref-type=event]:hover{border-color:#8e44e659}body.dark-mode .chat-ref-chip[data-ref-type=customer]:hover{border-color:#e67e2259}.chat-ref-chip-icon{font-size:11px;color:var(--accent);flex-shrink:0;width:16px;text-align:center}.chat-ref-chip[data-ref-type=task]{background:#0070f31a}.chat-ref-chip[data-ref-type=task] .chat-ref-chip-icon{color:#0070f3}.chat-ref-chip[data-ref-type=event]{background:#8e44e61a}.chat-ref-chip[data-ref-type=event] .chat-ref-chip-icon{color:#8e44e6}.chat-ref-chip[data-ref-type=customer]{background:#e67e221a}.chat-ref-chip[data-ref-type=customer] .chat-ref-chip-icon{color:#e67e22}.message.sent .chat-ref-chips,.message.sent .chat-ref-files{align-self:flex-end}.chat-ref-files{display:flex;gap:8px;margin-bottom:6px;max-width:85%;position:relative}.chat-ref-file-tile{width:140px;min-height:100px;border-radius:12px;background:var(--bg-surface);border:1px solid var(--border-subtle);padding:12px;display:flex;flex-direction:column;gap:8px;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .15s ease;position:relative;overflow:hidden}.chat-ref-file-tile:hover{box-shadow:0 8px 24px #0000001a;border-color:var(--accent)}.chat-ref-files:not(.stacked) .chat-ref-file-tile:hover{transform:translateY(-3px)}.chat-ref-files:not(.stacked):not(.multi) .chat-ref-file-tile{transform:none}.chat-ref-file-icon{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}.chat-ref-file-icon svg{width:20px;height:20px}.chat-ref-file-icon[data-ref-type=sheet]{background:#34c7591f;color:#34c759}.chat-ref-file-icon[data-ref-type=doc]{background:#007aff1a;color:#007aff}.chat-ref-file-name{font-size:12px;font-weight:600;color:var(--text-main);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.3}.chat-ref-file-meta{font-size:10px;color:var(--text-muted);margin-top:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-ref-files.stacked{padding:20px 0 0 20px}.chat-ref-files.stacked .chat-ref-file-tile:first-child{z-index:2;position:relative;transform:rotate(3deg);transition:transform .35s cubic-bezier(.4,0,.2,1)}.chat-ref-files.stacked .chat-ref-file-tile:nth-child(2){position:absolute;z-index:1;left:-14px;top:-14px;transform:rotate(-6deg);opacity:.92;transition:transform .35s cubic-bezier(.4,0,.2,1),left .35s cubic-bezier(.4,0,.2,1),top .35s cubic-bezier(.4,0,.2,1),opacity .35s ease}.chat-ref-files.stacked:hover .chat-ref-file-tile:first-child{transform:rotate(2deg) translate(5px,3px)}.chat-ref-files.stacked:hover .chat-ref-file-tile:nth-child(2){left:-32px;top:-24px;transform:rotate(-4deg);opacity:1}.message:not(.sent) .chat-ref-files.stacked{padding:20px 40px 0 0}.message:not(.sent) .chat-ref-files.stacked .chat-ref-file-tile:nth-child(2){left:auto;right:-36px;top:-12px;transform:rotate(4deg);transition:transform .35s cubic-bezier(.4,0,.2,1),right .35s cubic-bezier(.4,0,.2,1),top .35s cubic-bezier(.4,0,.2,1),opacity .35s ease}.message:not(.sent) .chat-ref-files.stacked:hover .chat-ref-file-tile:first-child{transform:rotate(-1deg) translate(-4px,2px)}.message:not(.sent) .chat-ref-files.stacked:hover .chat-ref-file-tile:nth-child(2){left:auto;right:-52px;top:-18px;transform:rotate(3deg);opacity:1}.chat-ref-files.multi{gap:0;padding:6px 0 0}.chat-ref-files.multi .chat-ref-file-tile{width:120px;min-height:88px;margin-left:-16px}.chat-ref-files.multi .chat-ref-file-tile:first-child{margin-left:0}.chat-ref-files.multi .chat-ref-file-tile:nth-child(1){transform:rotate(-2deg);z-index:4}.chat-ref-files.multi .chat-ref-file-tile:nth-child(2){transform:rotate(2.5deg);z-index:3}.chat-ref-files.multi .chat-ref-file-tile:nth-child(3){transform:rotate(-1.5deg);z-index:2}.chat-ref-files.multi .chat-ref-file-tile:nth-child(4){transform:rotate(2deg);z-index:1}.chat-ref-files.multi .chat-ref-file-tile:hover{transform:translateY(-4px) rotate(0);z-index:10}.message.sent .chat-ref-file-tile{align-self:flex-end;background:#fafbfb;border:1.5px solid #ededf0}.message:not(.sent) .chat-ref-file-tile{background:#f4f5f6;border:1.5px solid #e8e9ec}.chat-composer-refs{display:flex;flex-wrap:wrap;gap:6px;padding:0 0 6px}.chat-composer-refs:empty{display:none}.chat-composer-chip{position:relative;cursor:default;animation:refTagIn .15s ease-out}@keyframes refTagIn{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.chat-composer-chip-remove{width:16px;height:16px;border-radius:50%;border:none;background:#00000014;color:var(--text-muted);font-size:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-left:2px;transition:background .12s ease,color .12s ease;padding:0;line-height:1}.chat-composer-chip-remove:hover{background:#ff3b3026;color:#ff3b30}.chat-composer-file-tiles{display:flex;gap:8px;padding:6px 6px 6px 0;position:relative;overflow:visible}.chat-composer-file-tiles:empty{display:none}.chat-composer-file-tile{width:100px!important;min-height:70px!important;padding:8px!important;gap:5px!important;animation:refTagIn .15s ease-out;position:relative;background:var(--bg-body)!important;overflow:visible!important;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .15s ease,border-color .15s ease}.chat-composer-file-tile:nth-child(1){transform:rotate(-1.5deg)}.chat-composer-file-tile:nth-child(2){transform:rotate(2.5deg)}.chat-composer-file-tile:nth-child(3){transform:rotate(-2deg)}.chat-composer-file-tile:nth-child(4){transform:rotate(1.5deg)}.chat-composer-file-tile:hover{transform:rotate(0) translateY(-2px)!important;box-shadow:0 4px 14px #0000001a;border-color:var(--accent);z-index:5}.chat-composer-file-tile .chat-ref-file-icon{width:28px;height:28px;border-radius:8px;font-size:13px}.chat-composer-file-tile .chat-ref-file-icon svg{width:16px;height:16px}.chat-composer-file-tile .chat-ref-file-name{font-size:10.5px}.chat-composer-file-tile .chat-ref-file-meta{font-size:9px}.chat-composer-tile-remove{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;border:1.5px solid var(--bg-surface);background:#0000008c;color:#fff;font-size:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;opacity:0;transform:scale(.7);transition:opacity .15s ease,transform .15s ease,background .12s ease;padding:0;line-height:1;z-index:10}.chat-composer-file-tile:hover .chat-composer-tile-remove{opacity:1;transform:scale(1)}.chat-composer-tile-remove:hover{background:#ff3b30}.chat-add-menu{position:absolute;bottom:calc(100% + 8px);left:10px;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:12px;box-shadow:0 8px 32px #00000024,0 2px 8px #0000000f;min-width:200px;padding:6px;z-index:10001;animation:chatAddMenuIn .14s ease-out;display:none}.chat-add-menu.active{display:block}.chat-add-menu.chat-add-menu--below{bottom:auto;top:calc(100% + 8px)}@keyframes chatAddMenuIn{0%{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes chatAddMenuInBelow{0%{opacity:0;transform:translateY(-6px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}.chat-add-menu--below{animation-name:chatAddMenuInBelow}.chat-add-menu-item{display:flex;align-items:center;gap:10px;padding:9px 14px;border-radius:8px;cursor:pointer;transition:background .15s ease;color:var(--text-main);font-size:13px;font-weight:500;background:transparent;border:none;width:100%;text-align:left}.chat-add-menu-item:hover{background:var(--bg-hover, rgba(0, 0, 0, .04))}.chat-add-menu-item i{width:18px;text-align:center;font-size:14px}.chat-add-menu-item i.fa-check-circle{color:#0070f3}.chat-add-menu-item i.fa-calendar{color:#8e44e6}.chat-add-menu-item i.fa-user-tie{color:#e67e22}.chat-add-menu-item i.fa-table{color:#34c759}.chat-add-menu-item i.fa-file-alt{color:#ff3b30}.chat-add-menu-item i.fa-poll{color:#5ac8fa}.chat-add-menu-divider{height:1px;background:var(--border-subtle);margin:4px 8px}.chat-ref-picker{width:480px;height:560px;display:flex;flex-direction:column;border-radius:16px;overflow:hidden}.chat-ref-picker-header{padding:0;border-bottom:1px solid var(--border-subtle);flex-shrink:0}.chat-ref-picker-title-row{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 8px}.chat-ref-picker-title-row h3{margin:0;font-size:15px;font-weight:700;color:var(--text-main)}.chat-ref-picker-search{display:flex;align-items:center;gap:12px;margin:0 16px 10px;background:var(--bg-surface);padding:10px 18px;border-radius:999px;border:1.5px solid var(--border-subtle);transition:all var(--transition-fast)}.chat-ref-picker-search:focus-within{border-color:var(--accent)}.chat-ref-picker-search i{color:var(--text-muted);font-size:14px;flex-shrink:0}.chat-ref-picker-search input{flex:1;border:none;background:transparent;outline:none;font-size:14px;color:var(--text-main);font-family:var(--font-family)}.chat-ref-picker-search input::placeholder{color:var(--text-muted)}.chat-ref-picker-tabs{display:flex;gap:0;padding:0 16px;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.chat-ref-picker-tabs::-webkit-scrollbar{display:none}.chat-ref-picker-tab{background:transparent;border:none;border-bottom:2px solid transparent;padding:10px 16px;font-size:13px;font-weight:500;color:var(--text-muted);cursor:pointer;white-space:nowrap;transition:color .15s;display:flex;align-items:center;gap:5px;margin-bottom:-1px}.chat-ref-picker-tab i{font-size:11px}.chat-ref-picker-tab:hover{color:var(--text-main)}.chat-ref-picker-tab.active{color:var(--text-main);font-weight:600;border-bottom-color:var(--text-main)}.chat-ref-picker-body{flex:1;min-height:0;overflow-y:auto;padding:4px 0;overscroll-behavior:contain}.chat-ref-picker-section{padding:0 8px}.chat-ref-picker-section-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);padding:12px 10px 6px;display:flex;align-items:center;gap:6px}.chat-ref-picker-section-label i{font-size:11px;color:var(--accent)}.chat-ref-picker-list{padding:0 2px}.chat-ref-picker-row{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:10px;cursor:pointer;transition:background .12s ease;border:none;background:transparent;width:100%;text-align:left;position:relative}.chat-ref-picker-row:hover{background:var(--bg-hover, rgba(0, 0, 0, .04))}.chat-ref-picker-row.selected{background:#0070f30f}.chat-ref-picker-row-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:13px;flex-shrink:0;-webkit-text-stroke:.4px}.chat-ref-picker-row-icon svg{width:15px;height:15px;stroke-width:1.5}.chat-ref-picker-row-body{flex:1;min-width:0}.chat-ref-picker-row-title{font-size:13px;font-weight:600;color:var(--text-main);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-ref-picker-row-sub{font-size:11.5px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1px}.chat-ref-picker-row-check{width:20px;height:20px;border-radius:50%;border:1.5px solid var(--border-subtle);display:flex;align-items:center;justify-content:center;font-size:10px;color:transparent;flex-shrink:0;transition:all .15s ease}.chat-ref-picker-row.selected .chat-ref-picker-row-check{background:var(--accent);border-color:var(--accent);color:#fff}.chat-ref-picker-empty{display:flex;flex-direction:column;align-items:center;gap:6px;padding:40px 16px;color:var(--text-muted);font-size:13px}.chat-ref-picker-empty i{font-size:24px;opacity:.25}.chat-ref-picker-loading{display:flex;align-items:center;justify-content:center;gap:8px;padding:32px 16px;color:var(--text-secondary);font-size:13px}.chat-ref-picker-spinner{width:16px;height:16px;border:2px solid var(--border-subtle);border-top-color:var(--accent);border-radius:50%;animation:refPickerSpin .6s linear infinite}@keyframes refPickerSpin{to{transform:rotate(360deg)}}.chat-ref-picker-footer{display:none;align-items:center;justify-content:space-between;padding:10px 16px;border-top:1px solid var(--border-subtle);background:var(--bg-surface);flex-shrink:0;animation:refPickerFooterIn .15s ease}@keyframes refPickerFooterIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}.chat-ref-picker-count{font-size:12px;font-weight:600;color:var(--text-muted)}.chat-ref-picker-attach-btn{display:flex;align-items:center;gap:6px;padding:7px 20px;border-radius:999px;border:none;background:var(--accent);color:#fff;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s ease,transform .1s ease}.chat-ref-picker-attach-btn:hover{filter:brightness(1.08)}.chat-ref-picker-attach-btn:active{transform:scale(.97)}.chat-ref-picker-attach-btn i{font-size:11px}.chat-ref-tooltip{position:fixed;z-index:10005;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:10px;box-shadow:0 8px 28px #00000024;padding:12px 14px;max-width:290px;min-width:180px;pointer-events:none;animation:chatRefTipIn .12s ease-out}@keyframes chatRefTipIn{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.chat-ref-tooltip-title{font-size:13px;font-weight:600;color:var(--text-main);line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.chat-ref-tip-chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.chat-ref-tip-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:999px;font-size:11px;font-weight:600;line-height:1.4;white-space:nowrap}.chat-ref-tip-chip i{font-size:9.5px;opacity:.85}.chat-ref-tip-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.chat-ref-tip-people{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:9px;padding-top:9px;border-top:1px solid var(--border-subtle)}.chat-ref-tip-person{display:inline-flex;align-items:center;gap:6px;min-width:0}.chat-ref-tip-avatar{position:relative;overflow:hidden;width:22px;height:22px;border-radius:50%;flex-shrink:0;background:var(--accent);color:#fff;font-size:9.5px;font-weight:700;display:flex;align-items:center;justify-content:center;text-transform:uppercase}.chat-ref-tip-person-name{font-size:11.5px;font-weight:500;color:var(--text-main);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-ref-tip-lines{margin-top:8px;font-size:11.5px;color:var(--text-muted);line-height:1.45}.chat-ref-tip-line{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}body.dark-mode .chat-ref-chip[data-ref-type=task]{background:#0070f324}body.dark-mode .chat-ref-chip[data-ref-type=event]{background:#8e44e624}body.dark-mode .chat-ref-chip[data-ref-type=customer]{background:#e67e2224}body.dark-mode .chat-ref-chip:hover{box-shadow:0 2px 8px #0070f333}body.dark-mode .chat-ref-file-tile{background:var(--bg-body);border-color:var(--border-medium)}body.dark-mode .chat-ref-file-tile:hover{box-shadow:0 8px 24px #0000004d}body.dark-mode .message.sent .chat-ref-file-tile{background:#1e1e1e;border-color:var(--border-medium)}body.dark-mode .message:not(.sent) .chat-ref-file-tile{background:#1a1a1a;border-color:var(--border-medium)}body.dark-mode .chat-add-menu{box-shadow:0 8px 32px #00000059,0 2px 8px #0003}body.dark-mode .chat-composer-chip-remove{background:#ffffff1a}body.dark-mode .chat-composer-tile-remove{background:#ffffff8c;color:#000;border-color:var(--bg-body)}body.dark-mode .chat-ref-tooltip{box-shadow:0 8px 28px #0006}body.dark-mode .chat-ref-picker-row.selected{background:#0070f31a}body.dark-mode .chat-ref-picker-row-check{border-color:var(--border-medium)}body.dark-mode .chat-ref-picker-search{background:transparent;border-color:var(--border-subtle)}body.dark-mode .chat-ref-picker-search:focus-within{background:transparent;border-color:var(--accent)}body.dark-mode .chat-ref-picker-attach-btn{background:var(--accent)}@media(max-width:600px){.chat-ref-file-tile{width:110px;min-height:80px;padding:10px}.chat-ref-file-icon{width:28px;height:28px;font-size:13px}.chat-ref-file-name{font-size:11px}.chat-ref-files.stacked{padding:14px 0 0 14px}.chat-ref-files.multi .chat-ref-file-tile{width:100px;min-height:72px;margin-left:-10px}.chat-composer-file-tile{width:85px!important;min-height:60px!important;padding:6px!important}.chat-composer-file-tile .chat-ref-file-icon{width:22px;height:22px;font-size:11px}.chat-composer-file-tile .chat-ref-file-name{font-size:9px}.chat-composer-file-tile .chat-ref-file-meta{font-size:8px}.chat-add-menu{min-width:180px}.chat-ref-picker{width:calc(100vw - 32px);max-height:70vh}n .chat-ref-picker-tabs{gap:0}.chat-ref-picker-tab{padding:8px;font-size:11px}}.chat-ref-images{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;margin-bottom:4px}.message.sent .chat-ref-images{justify-content:flex-end}.chat-ref-image{max-width:min(70%,280px);border-radius:12px;overflow:hidden;cursor:pointer;background:var(--bg-body, #f1f5f9);line-height:0}.chat-ref-images.multi .chat-ref-image{max-width:160px}.chat-ref-images.multi .chat-ref-image-img{max-height:200px}.chat-ref-image-img{display:block;width:100%;height:auto;max-height:320px;object-fit:cover;border-radius:12px}.chat-composer-image-preview{display:flex;flex-wrap:wrap;gap:8px;padding:6px 0 12px}.chat-composer-image-thumb{position:relative;width:72px;height:72px;border-radius:10px;overflow:hidden;border:1px solid var(--border-color, #e2e8f0)}.chat-composer-image-thumb img{width:100%;height:100%;object-fit:cover;display:block}.chat-composer-img-remove{position:absolute;top:4px;right:4px;width:20px;height:20px;border:none;border-radius:50%;background:#0000008c;color:#fff;font-size:10px;display:flex;align-items:center;justify-content:center;cursor:pointer}.chat-composer-img-remove:hover{background:#000000bf}.chat-composer-image-spinner{position:absolute;inset:0;display:none;align-items:center;justify-content:center;background:#0006;color:#fff;font-size:18px}.chat-composer-image-preview.sending .chat-composer-image-spinner{display:flex}.chat-composer-image-preview.sending .chat-composer-img-remove{display:none}.chat-composer-send.sending{opacity:.6;pointer-events:none}.chat-img-lightbox{position:fixed;inset:0;z-index:10000;background:#000000d9;display:flex;align-items:center;justify-content:center;animation:chatImgLightboxFade .15s ease}@keyframes chatImgLightboxFade{0%{opacity:0}to{opacity:1}}.chat-img-lightbox img{max-width:92vw;max-height:92vh;border-radius:8px;object-fit:contain}.chat-img-lightbox-close{position:absolute;top:calc(16px + env(safe-area-inset-top,0px));right:16px;width:36px;height:36px;border:none;border-radius:50%;background:#ffffff26;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;cursor:pointer}.chat-img-lightbox-close:hover{background:#ffffff4d}body.dark-mode .chat-ref-image{background:#ffffff0f}body.dark-mode .chat-composer-image-thumb{border-color:var(--border-subtle, #333)}@media(max-width:600px){.chat-ref-image{max-width:min(75%,240px)}.chat-ref-image-img{max-height:280px}}
