/* Chat matches Email: neutral white panels, fine borders, blue active state. */
body:has(.fc-chat-three){height:100dvh;overflow:hidden}
body:has(.fc-chat-three) .app{height:100dvh;min-height:0}
body:has(.fc-chat-three) .main{min-height:0;display:flex;flex-direction:column}
body:has(.fc-chat-three) .content{width:100%;max-width:none;flex:1;min-height:0;display:flex;flex-direction:column;padding-bottom:16px}
body:has(.fc-chat-three) #view{flex:1;min-height:0;display:flex;flex-direction:column}
#view .fc-chat-workspace.fc-chat-three{display:grid!important;flex:1;min-height:0;height:auto;grid-template-columns:minmax(190px,1fr) minmax(190px,1fr) minmax(0,2fr)!important;gap:12px!important;border:0;background:transparent;box-shadow:none;overflow:hidden}
#view .fc-chat-three .fc-chat-column{display:grid!important;min-width:0;min-height:0;gap:12px;border:0}
#view .fc-chat-three .fc-chat-column:first-child{grid-template-rows:minmax(0,2fr) minmax(0,1fr)}
#view .fc-chat-three .fc-chat-column:nth-child(2){grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
#view .fc-chat-three .fc-chat-section,#view .fc-chat-three .fc-chat-right{min-height:0;min-width:0;background:#fff!important;border:1px solid #e2e8f0!important;border-radius:14px;box-shadow:none;overflow:hidden}
#view .fc-chat-three .fc-chat-section{display:flex;flex-direction:column;padding:0!important;flex:none!important}
#view .fc-chat-three .fc-chat-section header{display:flex;align-items:center;justify-content:space-between;min-height:52px;box-sizing:border-box;padding:14px 16px;margin:0!important;border:0!important;border-bottom:1px solid #e8edf3!important;background:#fff!important;color:#243950!important;font-size:14px;font-weight:650;letter-spacing:0}
#view .fc-chat-three .fc-chat-section-list{flex:1;min-height:0;overflow-y:auto;padding:6px 12px}
#view .fc-chat-three .fc-chat-person{display:block;width:100%;margin:0;padding:11px 10px;text-align:left;background:#fff;border:0;border-bottom:1px solid #edf1f5;border-radius:0;color:#33445b;cursor:pointer;box-shadow:none}
#view .fc-chat-three .fc-chat-person:hover{background:#edf4ff;border-radius:8px}
#view .fc-chat-three .fc-chat-person.active{background:#dceaff!important;border-left:3px solid #3977dc;padding-left:7px;border-radius:9px}
#view .fc-chat-three .fc-chat-person[hidden]{display:none}
#view .fc-chat-three .fc-chat-person strong{font-size:13px;color:#243950}
#view .fc-chat-three .fc-chat-person small{font-size:12px;color:#8492a5}
#view .fc-chat-three .fc-chat-right{display:flex;flex-direction:column}
#view .fc-chat-three .fc-chat-heading{padding:16px;border-bottom:1px solid #e8edf3;background:#fff;color:#243950;font-size:14px;font-weight:650}
#view .fc-chat-three .fc-chat-messages{flex:1;min-height:0;max-height:none;background:#fff;overflow-y:auto}
#view .fc-chat-three .fc-chat-form{background:#fff;border-top:1px solid #e8edf3}
#view .fc-chat-three .fc-chat-message{background:#f7f9fc;border:1px solid #e9eef5}
#view .fc-chat-three .fc-chat-invite{border:1px solid #d9e4f3;background:#fff;color:#3976d9;border-radius:8px;padding:6px 10px;font-size:12px;font-weight:600;cursor:pointer}
#view .fc-chat-three .fc-chat-invite:hover{background:#edf4ff}
@media(max-width:850px){#view .fc-chat-workspace.fc-chat-three{grid-template-columns:1fr!important;height:auto;overflow:visible}body:has(.fc-chat-three){height:auto;overflow:auto}#view .fc-chat-three .fc-chat-column:first-child,#view .fc-chat-three .fc-chat-column:nth-child(2){grid-template-rows:none;grid-auto-rows:minmax(190px,auto)}#view .fc-chat-three .fc-chat-section{min-height:190px;max-height:320px}#view .fc-chat-three .fc-chat-right{min-height:430px}}

/* Compact matching add buttons in panel headings */
#view .fc-chat-three .fc-chat-section header{gap:7px;white-space:nowrap;font-size:clamp(11px,0.85vw,14px);padding-left:11px;padding-right:11px}
#view .fc-chat-three .fc-chat-section header .fc-chat-invite,#view .fc-chat-three .fc-chat-section header .fc-chat-add-group,#view .fc-chat-three .fc-chat-section header .fc-chat-add-event{flex:0 0 27px;width:27px;height:27px;display:inline-flex;align-items:center;justify-content:center;padding:0!important;border:1px solid #d9e4f3;background:#fff;color:#3976d9;border-radius:7px;font-size:20px;line-height:1;font-weight:500;cursor:pointer}
#view .fc-chat-three .fc-chat-section header button:hover{background:#edf4ff}

.fc-chat-modal-backdrop{position:fixed;inset:0;z-index:10050;background:rgba(19,39,67,.43);display:flex;align-items:center;justify-content:center;padding:16px}
.fc-chat-modal{width:min(600px,100%);max-height:92dvh;overflow:auto;background:#fff;border:1px solid #dce5f0;border-radius:15px;box-shadow:0 24px 70px rgba(14,38,72,.22);color:#243950}
.fc-chat-modal-head{display:flex;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid #e5ebf3}
.fc-chat-modal-head h2{font-size:18px;margin:0}.fc-chat-modal-head button{font-size:25px;background:transparent;border:0;cursor:pointer;color:#6c7d92}
.fc-chat-modal-form{padding:20px 22px;display:grid;gap:16px}
.fc-chat-modal-form>label{display:grid;gap:7px;font-size:13px;font-weight:650;color:#405672}
.fc-chat-modal-form .field{width:100%;box-sizing:border-box}
.fc-chat-member-head{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid #e9eef5;padding-top:14px}
.fc-chat-member-head button{border:1px solid #d8e3f1;background:#fff;border-radius:8px;padding:7px 10px;color:#3976d9;cursor:pointer}
.fc-chat-modal-members{display:grid;gap:8px;max-height:200px;overflow-y:auto}
.fc-chat-modal-member{display:flex;align-items:center;gap:10px}
.fc-chat-modal-member select{flex:1;min-width:0}
.fc-chat-modal-member label{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:12px}
.fc-chat-modal-member button{border:0;background:transparent;font-size:20px;color:#687b91;cursor:pointer}
.fc-chat-modal-actions{display:flex;justify-content:flex-end;gap:9px;border-top:1px solid #e8edf3;padding-top:15px}
.fc-chat-modal-actions button{padding:9px 14px;border:1px solid #dce5ef;background:#fff;border-radius:8px;cursor:pointer}
.fc-chat-modal-actions button[type=submit]{background:#3976d9;color:#fff;border-color:#3976d9}
.fc-chat-modal-actions button[data-delete]{margin-right:auto;color:#a13c3c}
.fc-chat-modal-actions button:disabled{opacity:.35;cursor:not-allowed}
.fc-chat-modal-error{color:#b33737;margin:0;font-size:13px}

/* Message layout: sender on left, own messages on right; restrained email-style palette. */
#view .fc-chat-three .fc-chat-messages{padding:18px 18px 22px;background:#fff;display:block}
#view .fc-chat-three .fc-chat-day{text-align:center;margin:18px 0 13px;color:#78869b;font-size:12px;font-weight:600}
#view .fc-chat-three .fc-chat-line{display:flex;width:100%;margin:0 0 12px;clear:both}
#view .fc-chat-three .fc-chat-line-other{justify-content:flex-start}
#view .fc-chat-three .fc-chat-line-mine{justify-content:flex-end}
#view .fc-chat-three .fc-chat-bubble{display:flex;flex-direction:column;gap:6px;width:fit-content;max-width:min(82%,540px);padding:11px 14px;border:1px solid #e2e9f2;border-radius:15px 15px 15px 4px;background:#f4f7fb;color:#26384f;overflow-wrap:anywhere;box-shadow:none}
#view .fc-chat-three .fc-chat-line-mine .fc-chat-bubble{background:#e8f1ff;border-color:#d3e3fb;border-radius:15px 15px 4px 15px}
#view .fc-chat-three .fc-chat-sender{font-size:12px;font-weight:700;color:#37649c}
#view .fc-chat-three .fc-chat-text{font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
#view .fc-chat-three .fc-chat-time{align-self:flex-end;font-size:11px;line-height:1.2;color:#75859b;white-space:nowrap}
@media(max-width:600px){#view .fc-chat-three .fc-chat-bubble{max-width:92%}#view .fc-chat-three .fc-chat-messages{padding:12px}}

/* Message metadata on hover/focus, initials beside every message. */
#view .fc-chat-three .fc-chat-line{align-items:flex-end;gap:9px;position:relative}
#view .fc-chat-three .fc-chat-line-mine{flex-direction:row-reverse;justify-content:flex-start}
#view .fc-chat-three .fc-chat-avatar{display:flex;align-items:center;justify-content:center;flex:0 0 33px;width:33px;height:33px;border-radius:50%;background:#dfe8f4;color:#31547e;border:1px solid #cbd9eb;font-size:12px;font-weight:700;letter-spacing:.02em;user-select:none}
#view .fc-chat-three .fc-chat-line-mine .fc-chat-avatar{background:#d9e8ff;color:#245fa5}
#view .fc-chat-three .fc-chat-bubble{position:relative;max-width:min(78%,510px);gap:0}
#view .fc-chat-three .fc-chat-time,#view .fc-chat-three .fc-chat-sender{display:none!important}
#view .fc-chat-three .fc-chat-tooltip{display:none;position:absolute;bottom:calc(100% + 6px);left:8px;z-index:5;padding:6px 9px;border-radius:7px;background:#283d59;color:#fff;font-size:11px;font-weight:500;line-height:1.2;white-space:nowrap;box-shadow:0 3px 12px rgba(0,0,0,.12);pointer-events:none}
#view .fc-chat-three .fc-chat-line-mine .fc-chat-tooltip{left:auto;right:8px}
#view .fc-chat-three .fc-chat-bubble:hover .fc-chat-tooltip,#view .fc-chat-three .fc-chat-bubble:focus-visible .fc-chat-tooltip{display:block}
@media(max-width:600px){#view .fc-chat-three .fc-chat-avatar{flex-basis:29px;width:29px;height:29px;font-size:11px}#view .fc-chat-three .fc-chat-bubble{max-width:calc(100% - 47px)}}

/* Variant: received messages without bubble background (revert via .before-incoming-transparent.bak). */
#view .fc-chat-three .fc-chat-line-other .fc-chat-bubble{background:transparent!important;border-color:transparent!important;box-shadow:none!important;padding-left:4px;padding-right:8px}

/* Incoming message: align first text line with the avatar center. */
#view .fc-chat-three .fc-chat-line-other{align-items:flex-start}
#view .fc-chat-three .fc-chat-line-other .fc-chat-avatar{margin-top:0}
#view .fc-chat-three .fc-chat-line-other .fc-chat-bubble{padding-top:6px;padding-bottom:6px}
/* Outgoing message: compact spacing matching contact list items. */
#view .fc-chat-three .fc-chat-line-mine .fc-chat-bubble{padding:7px 10px}

/* Group/event membership: identical centered checkbox columns */
.fc-chat-member-details summary{cursor:pointer;font-weight:650;padding:10px 0}
.fc-chat-modal-members{display:block;max-height:260px;overflow-y:auto}
.fc-chat-member-grid{display:grid;grid-template-columns:minmax(0,1fr) 64px 64px;align-items:center;gap:8px;padding:7px 5px}
.fc-chat-member-grid-head{font-weight:650;border-bottom:1px solid #dce5f0}
.fc-chat-member-grid>span:nth-child(n+2){text-align:center}
.fc-chat-member-grid input[type=checkbox]{justify-self:center;margin:0;width:16px;height:16px}
.fc-chat-modal-member{display:grid}

#view .fc-chat-three .fc-chat-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.fc-chat-manage{border:1px solid #d8e3f1;background:#fff;color:#3976d9;border-radius:8px;padding:7px 10px;cursor:pointer;font-size:12px}
.fc-chat-leave{border:1px solid #b85656!important;color:#a13c3c!important;margin-right:auto}

/* Guest invitation modal: separate from the chat columns. */
.fc-chat-guest-overlay{position:fixed;inset:0;z-index:11000;background:rgba(18,35,58,.46);display:flex;align-items:center;justify-content:center;padding:18px}
.fc-chat-guest-dialog{width:min(440px,100%);max-height:90vh;overflow:auto;background:#fff;color:#26384f;border:1px solid #dce5ef;border-radius:14px;box-shadow:0 18px 60px rgba(0,0,0,.23);padding:22px;display:flex;flex-direction:column;gap:14px}
.fc-chat-guest-dialog h3{margin:0;font-size:18px}
.fc-chat-guest-dialog label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:600}
.fc-chat-guest-dialog select{width:100%;padding:10px;border:1px solid #cbd8e7;border-radius:8px;background:#fff;color:#26384f;font:inherit}
.fc-chat-guest-dialog p{margin:0;font-size:13px}
.fc-chat-guest-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:4px}
.fc-chat-guest-actions button{padding:9px 14px;border:1px solid #dce5ef;border-radius:8px;cursor:pointer}
.fc-chat-guest-actions .btn{background:#3976d9;color:white;border-color:#3976d9}
.fc-chat-guest-actions button:disabled{opacity:.45;cursor:not-allowed}
/* Consistent desktop chat composer sizing and insets */
@media (min-width:851px){
 #view .fc-chat-three .fc-chat-form{display:flex;align-items:center;gap:8px;padding:12px!important;margin:0!important;box-sizing:border-box;flex:0 0 auto}
 #view .fc-chat-three .fc-chat-form textarea{height:40px!important;min-height:40px!important;max-height:40px!important;resize:none!important;box-sizing:border-box;padding:9px 12px!important;line-height:20px;overflow-y:auto;margin:0!important}
 #view .fc-chat-three .fc-chat-form .btn{height:40px!important;min-height:40px!important;box-sizing:border-box;margin:0!important;flex:0 0 auto}
}
/* Remove the empty status paragraph's reserved height below composer. */
@media (min-width:851px){
 #view .fc-chat-three .fc-chat-status:empty{display:none!important;margin:0!important;padding:0!important;height:0!important}
 #view .fc-chat-three .fc-chat-status:not(:empty){margin:0!important;padding:4px 12px 8px!important;font-size:12px}
 #view .fc-chat-three .fc-chat-form{margin-bottom:0!important}
}
