.tjc-msg-office-page{display:grid;gap:16px}
.tjc-msg-office-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap}
.tjc-msg-team-picker{display:grid;gap:6px;min-width:240px;margin:0}
.tjc-msg-team-picker label,.tjc-msg-compose label>span{font-size:12px;font-weight:850;letter-spacing:.04em;text-transform:uppercase;color:#61728a}
.tjc-msg-team-picker select,.tjc-msg-compose select,.tjc-msg-compose textarea{width:100%;border:1px solid #ccd8e6;border-radius:12px;background:#fff;color:#1f2d3d;font:inherit;box-sizing:border-box}
.tjc-msg-team-picker select,.tjc-msg-compose select{height:42px;padding:0 12px}
.tjc-msg-compose textarea{display:block;min-height:78px;padding:10px 12px;resize:vertical;line-height:1.45}
.tjc-msg-center{background:#fff;border:1px solid #dbe5ef;border-radius:18px;overflow:hidden;box-shadow:0 10px 28px rgba(15,23,42,.05)}
.tjc-msg-center.is-new{border-color:#6da4ed;box-shadow:0 0 0 3px rgba(59,130,246,.11),0 10px 28px rgba(15,23,42,.05)}
.tjc-msg-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px 18px;border-bottom:1px solid #e5edf5;background:#f8fbff}
.tjc-msg-title{font-size:20px;line-height:1.2;font-weight:900;color:#17325a;letter-spacing:-.02em}
.tjc-msg-subtitle{margin-top:5px;font-size:13px;line-height:1.45;color:#66758a;max-width:700px}
.tjc-msg-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.tjc-msg-open-count{display:inline-flex;align-items:center;min-height:32px;padding:0 10px;border-radius:999px;background:#fff3d6;color:#7a4b00;border:1px solid #f2d391;font-size:12px;font-weight:900;white-space:nowrap}
.tjc-msg-open-count.is-clear{background:#eaf8ef;color:#18733b;border-color:#bde5c9}
.tjc-msg-refresh,.tjc-msg-send,.tjc-msg-status-btn{border:0;border-radius:10px;font:inherit;font-weight:850;cursor:pointer;transition:transform .15s ease,background .15s ease,opacity .15s ease}
.tjc-msg-refresh{min-height:34px;padding:0 12px;background:#e8eef7;color:#27415f}
.tjc-msg-send{min-height:42px;padding:0 18px;background:#1f6f4a;color:#fff}
.tjc-msg-refresh:hover,.tjc-msg-send:hover,.tjc-msg-status-btn:hover{transform:translateY(-1px)}
.tjc-msg-refresh:disabled,.tjc-msg-send:disabled,.tjc-msg-status-btn:disabled{opacity:.55;cursor:wait;transform:none}
.tjc-msg-list{display:grid;gap:10px;max-height:460px;min-height:150px;overflow:auto;padding:16px;background:#f3f7fb;scroll-behavior:smooth}
.tjc-msg-loading,.tjc-msg-empty-state{padding:22px;text-align:center;color:#6b7a90;font-weight:750}
.tjc-msg-item{max-width:min(82%,720px);border:1px solid #dbe5ef;border-radius:15px;padding:14px 18px;background:#fff;box-shadow:0 4px 12px rgba(15,23,42,.035);box-sizing:border-box}
.tjc-msg-item--technician{margin-left:auto;border-color:#bcd8cc;background:#f2fbf6}
.tjc-msg-item.is-done{opacity:.76}
.tjc-msg-item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:8px}
.tjc-msg-author{font-size:13px;font-weight:900;color:#203651}
.tjc-msg-time{margin-top:2px;font-size:11px;color:#758399}
.tjc-msg-badges{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.tjc-msg-type,.tjc-msg-status{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:900;letter-spacing:.03em;text-transform:uppercase;white-space:nowrap}
.tjc-msg-type{background:#e9f0fa;color:#35516f}
.tjc-msg-type--parts_required{background:#fff2d8;color:#805000}
.tjc-msg-type--urgent{background:#fee8e8;color:#a12323}
.tjc-msg-type--office_action{background:#ece9ff;color:#5541a8}
.tjc-msg-type--technician_action{background:#dff6ed;color:#146947}
.tjc-msg-status{background:#fff4d8;color:#815400}
.tjc-msg-status.is-done{background:#e3f4e9;color:#23693e}
.tjc-msg-body{font-size:14px;line-height:1.5;color:#26384f;white-space:pre-wrap;overflow-wrap:anywhere}
.tjc-msg-item-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding-top:9px;border-top:1px solid rgba(130,150,175,.2)}
.tjc-msg-completed{font-size:11px;color:#6b7a90}
.tjc-msg-status-btn{min-height:30px;padding:0 10px;background:#e7edf5;color:#27415f;font-size:12px}
.tjc-msg-compose{padding:14px 16px 16px;border-top:1px solid #e5edf5;background:#fff;margin:0}
.tjc-msg-compose-fields{display:grid;grid-template-columns:minmax(160px,220px) minmax(0,1fr);gap:12px;align-items:start}
.tjc-msg-compose label{display:grid;gap:6px;margin:0}
.tjc-msg-compose-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}
.tjc-msg-feedback{min-height:18px;font-size:12px;font-weight:750;color:#64748b}
.tjc-msg-feedback.is-error{color:#b42318}
.tjc-msg-center--technician{margin-bottom:14px}
.tjc-msg-center--technician .tjc-msg-header{padding:14px}
.tjc-msg-center--technician .tjc-msg-list{max-height:390px}
@media(max-width:760px){
  .tjc-msg-office-heading{align-items:stretch}.tjc-msg-team-picker{width:100%;min-width:0}
  .tjc-msg-header{display:grid;padding:14px}.tjc-msg-header-actions{justify-content:flex-start}
  .tjc-msg-title{font-size:18px}.tjc-msg-list{padding:10px;max-height:410px}
  .tjc-msg-item{max-width:96%;padding:13px 16px}.tjc-msg-item-head{display:grid}.tjc-msg-badges{justify-content:flex-start}
  .tjc-msg-compose{padding:12px}.tjc-msg-compose-fields{grid-template-columns:1fr}.tjc-msg-compose-actions{display:grid}.tjc-msg-send{width:100%}
  .tjc-msg-item-foot{align-items:flex-end}.tjc-msg-status-btn{flex:0 0 auto}
}

.tjc-msg-team-picker-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}.tjc-msg-team-picker-row button{min-height:42px;padding:0 14px;border:0;border-radius:10px;background:#274b73;color:#fff;font:inherit;font-weight:850;cursor:pointer}
@media(max-width:520px){.tjc-msg-team-picker-row{grid-template-columns:1fr}.tjc-msg-team-picker-row button{width:100%}}

/* Message filters */
.tjc-msg-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid #e5edf5;background:#fff}
.tjc-msg-filter{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:0 11px;border:1px solid #d7e1ec;border-radius:999px;background:#f8fbff;color:#42566f;font:inherit;font-size:12px;font-weight:850;white-space:nowrap;cursor:pointer}
.tjc-msg-filter:hover{border-color:#adc0d5;background:#f1f6fb}
.tjc-msg-filter.is-active{border-color:#2f6d50;background:#e9f6ee;color:#195638;box-shadow:0 0 0 2px rgba(47,109,80,.08)}
.tjc-msg-filter-count{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;padding:0 6px;border-radius:999px;background:#e8eef6;color:#3a4d65;font-size:10px;font-weight:950;box-sizing:border-box}
.tjc-msg-filter.is-active .tjc-msg-filter-count{background:#fff;color:#195638}
.tjc-msg-filter[data-tjc-message-filter="urgent"] .tjc-msg-filter-count{background:#fee8e8;color:#a12323}
.tjc-msg-filter[data-tjc-message-filter="completed"] .tjc-msg-filter-count{background:#e3f4e9;color:#23693e}

/* Dashboard message notification bell */
.tjc-message-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;border:1px solid #ced9e6;border-radius:12px;background:#fff;color:#35506f;text-decoration:none;box-sizing:border-box;transition:transform .15s ease,border-color .15s ease,background .15s ease}
.tjc-message-bell:hover{transform:translateY(-1px);border-color:#9fb3ca;background:#f8fbff}
.tjc-message-bell svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.tjc-message-bell-badge{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border:2px solid #fff;border-radius:999px;background:#d92d20;color:#fff;font-size:10px;font-weight:950;line-height:1;box-sizing:border-box}
.tjc-message-bell-badge.is-empty{display:none}
.tjc-message-bell.has-open-messages{border-color:#e3a4a0;background:#fff8f7;color:#9f231b}
.tjc-message-bell--technician{border-color:rgba(255,255,255,.34);background:rgba(255,255,255,.1);color:#fff}
.tjc-message-bell--technician:hover{border-color:rgba(255,255,255,.65);background:rgba(255,255,255,.18)}
.tjc-message-bell--technician.has-open-messages{border-color:#ffb4ad;background:rgba(217,45,32,.22);color:#fff}
.tjc-message-bell--technician .tjc-message-bell-badge{border-color:#263f67}

@media(max-width:760px){
  .tjc-msg-filters{padding:9px 10px}.tjc-msg-filter{min-height:32px;padding:0 10px}
  .tjc-message-bell{flex-basis:42px;width:42px;height:42px}
}

/* Dashboard conversation launcher and modal */
.tjc-msg-launch-card{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
.tjc-msg-open-conversation{min-height:42px;padding:0 18px;border:0;border-radius:12px;background:#1f6f4a;color:#fff;font:inherit;font-weight:900;cursor:pointer}
.tjc-msg-open-conversation:hover{background:#195d3e}
.tjc-message-bell[type="button"]{padding:0;cursor:pointer;font:inherit}
body.tjc-msg-modal-open{overflow:hidden}
.tjc-msg-modal[hidden]{display:none!important}
.tjc-msg-modal{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
.tjc-msg-modal-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:rgba(15,23,42,.62);cursor:pointer}
.tjc-msg-modal-dialog{position:relative;z-index:1;width:min(1040px,calc(100vw - 48px));max-height:calc(100vh - 48px);overflow:hidden;border-radius:20px;background:#fff;box-shadow:0 30px 80px rgba(15,23,42,.3)}
.tjc-msg-modal-close{position:absolute;top:10px;right:12px;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border:1px solid #d6e0eb;border-radius:11px;background:#fff;color:#334155;font-size:25px;line-height:1;cursor:pointer}
.tjc-msg-modal-close:hover{background:#f3f7fb}
.tjc-msg-modal .tjc-msg-center{border:0;border-radius:0;box-shadow:none}
.tjc-msg-modal .tjc-msg-header{padding-right:64px}
.tjc-msg-modal .tjc-msg-list{max-height:min(52vh,520px)}

/* Direct replies */
.tjc-msg-reply-quote{margin:0 0 9px;padding:8px 10px;border-left:3px solid #7a9cbc;border-radius:0 9px 9px 0;background:#f2f6fa}
.tjc-msg-reply-quote-author{font-size:11px;font-weight:900;color:#3f5873}
.tjc-msg-reply-quote-body{margin-top:3px;font-size:12px;line-height:1.35;color:#607086;white-space:pre-wrap;overflow-wrap:anywhere}
.tjc-msg-item-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.tjc-msg-reply-btn{min-height:30px;padding:0 10px;border:1px solid #cbd8e5;border-radius:10px;background:#fff;color:#27415f;font:inherit;font-size:12px;font-weight:850;cursor:pointer}
.tjc-msg-reply-btn:hover{background:#f3f7fb}
.tjc-msg-replying{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:9px 10px;border:1px solid #b9cee1;border-radius:11px;background:#f2f7fb}
.tjc-msg-replying[hidden]{display:none!important}
.tjc-msg-replying-copy{display:grid;gap:2px;min-width:0;color:#35506f;font-size:12px}
.tjc-msg-replying-copy>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#64748b}
.tjc-msg-cancel-reply{flex:0 0 auto;min-height:30px;padding:0 10px;border:1px solid #cbd8e5;border-radius:9px;background:#fff;color:#475569;font:inherit;font-size:12px;font-weight:850;cursor:pointer}

@media(max-width:760px){
  .tjc-msg-launch-card{align-items:stretch}.tjc-msg-open-conversation{width:100%}
  .tjc-msg-modal{align-items:stretch;padding:0}
  .tjc-msg-modal-dialog{width:100%;max-height:none;height:100%;border-radius:0;display:flex;flex-direction:column}
  .tjc-msg-modal .tjc-msg-center{display:flex;flex:1;min-height:0;flex-direction:column}
  .tjc-msg-modal .tjc-msg-list{flex:1;max-height:none;min-height:0}
  .tjc-msg-modal .tjc-msg-header{padding-right:58px}
  .tjc-msg-item-foot{align-items:flex-end;gap:8px}.tjc-msg-item-actions{justify-content:flex-end}
  .tjc-msg-replying{align-items:flex-start}.tjc-msg-replying-copy>span:last-child{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
}


/* Technician dashboard compact utility menu */
.tjc-tech-menu{position:relative;z-index:20;margin:0}
.tjc-tech-menu>summary{list-style:none}
.tjc-tech-menu>summary::-webkit-details-marker{display:none}
.tjc-tech-menu-toggle{position:relative;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:1px solid rgba(255,255,255,.32);border-radius:11px;background:rgba(255,255,255,.14);color:#fff;cursor:pointer}
.tjc-tech-menu-toggle svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.tjc-tech-menu-badge{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border:2px solid #29436d;border-radius:999px;background:#d92d20;color:#fff;font-size:10px;font-weight:950;box-sizing:border-box}
.tjc-tech-menu-badge.is-empty{display:none}
.tjc-tech-menu-panel{position:absolute;top:48px;right:0;width:min(360px,calc(100vw - 32px));padding:10px;border:1px solid #d7e1ec;border-radius:15px;background:#fff;box-shadow:0 18px 48px rgba(15,23,42,.24);color:#24324a;box-sizing:border-box}
.tjc-tech-menu-entry{display:flex;align-items:center;gap:10px;width:100%;min-height:54px;padding:10px 11px;border:0;border-radius:11px;background:#f5f8fc;color:#24324a;text-align:left;cursor:pointer}
.tjc-tech-menu-entry:hover{background:#edf3f9}
.tjc-tech-menu-entry-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;width:34px;height:34px;border-radius:10px;background:#e6eef8;font-size:17px}
.tjc-tech-menu-entry-copy{display:grid;gap:2px;min-width:0;flex:1}
.tjc-tech-menu-entry-copy strong{font-size:14px;color:#17325a}
.tjc-tech-menu-entry-copy small{font-size:11px;line-height:1.3;color:#6b7a90}
.tjc-tech-menu-entry-count{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:#d92d20;color:#fff;font-size:11px;font-weight:950}
.tjc-tech-menu-entry-count.is-empty{display:none}
.tjc-tech-menu-panel .tjc-push-device-card,.tjc-tech-menu-panel .tjc-location-device-card{margin:8px 0 0!important;padding:10px!important;border-radius:11px!important;box-shadow:none!important;background:#f8fbff!important}
.tjc-tech-menu-panel .tjc-push-device-card>div,.tjc-tech-menu-panel .tjc-location-device-card>div{display:grid!important;gap:8px!important}
.tjc-tech-menu-panel .tjc-push-device-card [style*="min-width"],.tjc-tech-menu-panel .tjc-location-device-card [style*="min-width"]{min-width:0!important}
.tjc-tech-menu-panel .tjc-link-btn{width:100%;min-height:38px}
@media(max-width:560px){.tjc-tech-menu-panel{position:fixed;top:76px;right:12px;left:12px;width:auto;max-height:calc(100vh - 96px);overflow:auto}.tjc-msg-filters{padding:8px 10px}.tjc-msg-filter{min-height:34px}}

/* Messaging usability corrections */
.tjc-msg-item{
  padding:16px 20px!important;
  overflow:hidden;
}
.tjc-msg-item-head,.tjc-msg-body,.tjc-msg-reply-quote,.tjc-msg-item-foot{
  margin-left:0!important;
  margin-right:0!important;
}
.tjc-msg-author,.tjc-msg-time,.tjc-msg-body{
  padding-left:0!important;
  text-indent:0!important;
}
.tjc-msg-compose-home{height:0;overflow:hidden}
.tjc-msg-compose.is-inline-reply{
  margin:14px -20px -16px!important;
  padding:14px 20px 16px!important;
  border-top:1px solid #dbe5ef;
  background:#f8fbff;
}
.tjc-msg-compose.is-inline-reply .tjc-msg-compose-fields{grid-template-columns:1fr}
.tjc-msg-compose.is-inline-reply .tjc-msg-replying{margin-bottom:10px}
.tjc-msg-compose.is-inline-reply .tjc-msg-compose-actions{margin-top:10px}
.tjc-tech-menu-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 10px;padding:2px 2px 9px;border-bottom:1px solid #e5edf5;color:#17325a}
.tjc-tech-menu-close{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid #d4deea;border-radius:10px;background:#fff;color:#334155;font-size:24px;line-height:1;cursor:pointer}
.tjc-tech-menu-close:hover{background:#f1f5f9}

@media(max-width:760px){
  .tjc-msg-item{max-width:100%!important;padding:15px 18px!important}
  .tjc-msg-compose.is-inline-reply{margin:14px -18px -15px!important;padding:13px 18px 15px!important}
  .tjc-msg-item-head{display:flex!important;align-items:flex-start!important}
  .tjc-msg-badges{justify-content:flex-end!important}
}

@media(max-width:560px){
  body:has(.tjc-tech-menu[open]){overflow:hidden!important}
  .tjc-tech-menu-panel{
    position:fixed!important;
    inset:0!important;
    width:100%!important;
    max-height:none!important;
    padding:calc(env(safe-area-inset-top,0px) + 72px) 16px calc(env(safe-area-inset-bottom,0px) + 20px)!important;
    overflow:auto!important;
    border:0!important;
    border-radius:0!important;
    z-index:100002!important;
    box-shadow:none!important;
  }
  .tjc-tech-menu-panel-head{
    position:sticky;
    top:calc(-1 * (env(safe-area-inset-top,0px) + 60px));
    z-index:2;
    padding:10px 0 12px;
    background:#fff;
  }
}

/* Office messages: inline conversation workspace. */
.tjc-msg-office-conversation{display:grid;gap:10px;min-width:0}
.tjc-msg-office-conversation-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border:1px solid #d9e3ef;border-radius:14px;background:#fff}
.tjc-msg-office-conversation-toolbar strong{display:block;margin-top:2px;color:#172b4d;font-size:16px}
.tjc-msg-expand-conversation{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 14px;border:1px solid #cad7e6;border-radius:10px;background:#f5f8fc;color:#29415f;font-weight:700;cursor:pointer}
.tjc-msg-expand-conversation:hover{background:#eaf1f8}
.tjc-msg-office-conversation .tjc-msg-center{box-shadow:none}
.tjc-msg-office-conversation.is-expanded{position:fixed;inset:20px;z-index:100000;padding:14px;border-radius:20px;background:#edf3fa;box-shadow:0 28px 80px rgba(15,23,42,.28);overflow:auto}
.tjc-msg-office-conversation.is-expanded .tjc-msg-center{min-height:calc(100vh - 125px)}
.tjc-msg-office-conversation.is-expanded .tjc-msg-list{max-height:calc(100vh - 410px);min-height:240px}
body.tjc-msg-office-expanded{overflow:hidden}
@media (max-width:700px){
  .tjc-msg-office-conversation-toolbar{align-items:flex-start;flex-direction:column}
  .tjc-msg-expand-conversation{width:100%}
  .tjc-msg-office-conversation.is-expanded{inset:0;padding:10px;border-radius:0}
  .tjc-msg-office-conversation.is-expanded .tjc-msg-list{max-height:none}
}
