﻿/* Workhour Meddelanden 2.0 – scoped: ändrar inte splash, auth eller andra vyer. */
.avatar{position:relative}.js-message-avatar-badge{position:absolute;right:-7px;top:-7px;min-width:19px;height:19px;padding:0 5px;border-radius:12px;background:#c73d4d;color:#fff;font:700 11px/19px Arial,sans-serif;text-align:center;box-shadow:0 0 0 2px #fff;z-index:2}.js-message-avatar-badge[hidden]{display:none!important}
.app-view[data-view="messages"]{--msg-brand:#bf5b4a;--msg-ink:#1d2b3b;--msg-muted:#6c7788;--msg-line:#e6ebf2;--msg-soft:#f2f5fa;--msg-card:#fff;color:var(--msg-ink)}
.app-view[data-view="messages"] [hidden]{display:none!important}
.wh-msg-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px}.wh-msg-header h1{font-size:clamp(25px,3vw,32px);font-weight:800;letter-spacing:-.035em;margin:4px 0}.wh-msg-header p{color:var(--msg-muted);margin:0}.wh-msg-header .eyebrow{font-size:11px;color:var(--msg-brand);font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.wh-msg-primary{border:0;background:var(--msg-brand);color:#fff;border-radius:13px;min-height:44px;padding:0 15px;font-weight:750;display:inline-flex;align-items:center;justify-content:center;gap:9px;cursor:pointer}.wh-msg-primary:disabled{opacity:.5}.wh-msg-error{color:#ad263b;font-size:13px;margin:4px 0}.wh-msg-error:empty{display:none}
.wh-msg-layout{display:grid;grid-template-columns:minmax(260px,.86fr) minmax(0,1.4fr);gap:16px;min-height:min(68vh,690px)}.wh-msg-inbox-panel,.wh-msg-thread-panel{background:var(--msg-card);border:1px solid var(--msg-line);border-radius:22px;min-width:0;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 5px 25px rgba(25,40,60,.025)}
.wh-msg-inbox-head{padding:18px 17px 11px;border-bottom:1px solid var(--msg-line)}.wh-msg-search-wrap{display:flex;align-items:center;gap:10px;border-radius:13px;background:var(--msg-soft);padding:0 13px;min-height:44px;color:var(--msg-muted)}.wh-msg-search{border:0;background:transparent;outline:0;min-width:0;width:100%;font-size:14px;color:var(--msg-ink)}.wh-msg-filters{display:flex;gap:5px;overflow-x:auto;scrollbar-width:none;padding:12px 0 2px}.wh-msg-filters button{border:0;background:transparent;border-radius:100px;padding:8px 12px;color:var(--msg-muted);font-size:12px;font-weight:750;white-space:nowrap;cursor:pointer}.wh-msg-filters button.is-active{background:var(--msg-ink);color:#fff}
.wh-msg-inbox-list{overflow-y:auto;flex:1;min-height:150px;overscroll-behavior:contain}.wh-msg-swipe{position:relative;overflow:hidden;border-bottom:1px solid var(--msg-line)}.wh-msg-row{display:flex;position:relative;z-index:1;gap:12px;align-items:flex-start;width:100%;padding:17px 15px;text-align:left;border:0;background:#fff;color:var(--msg-ink);cursor:pointer;transition:transform .2s}.wh-msg-row:hover,.wh-msg-swipe.is-active .wh-msg-row{background:#f8f9fc}.wh-msg-swipe.is-unread .wh-msg-row-title{font-weight:850}.wh-msg-avatar{width:43px;height:43px;flex:0 0 43px;border-radius:50%;display:grid;place-items:center;background:#f2d9bd;color:#7c4835;font-size:13px;font-weight:850}.wh-msg-row-main{min-width:0;flex:1}.wh-msg-row-title{display:block;font-size:14px;font-weight:750;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wh-msg-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;overflow-wrap:anywhere;color:var(--msg-muted);font-size:12px;line-height:1.5;margin-top:4px}.wh-msg-kind{font-size:10px;letter-spacing:.02em;color:#8b94a3;margin-top:7px;display:block}.wh-msg-row-side{flex:0 0 auto;display:flex;align-items:flex-end;flex-direction:column;gap:13px;font-size:11px;color:var(--msg-muted);white-space:nowrap}.wh-msg-unread{display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;background:#c83d4c;color:#fff;border-radius:12px;font-size:11px}.wh-msg-swipe-actions{position:absolute;inset:0 0 0 auto;display:flex}.wh-msg-swipe-actions button{border:0;background:#677a93;color:#fff;width:64px;font-size:16px;cursor:pointer}.wh-msg-swipe-actions button.danger{background:#b93445}.wh-msg-swipe.is-swiped .wh-msg-row{transform:translateX(-128px)}
.wh-msg-thread-head{display:flex;align-items:center;gap:12px;padding:17px;border-bottom:1px solid var(--msg-line)}.wh-msg-thread-head .wh-msg-avatar{width:38px;height:38px;flex-basis:38px}.wh-msg-thread-heading{flex:1;min-width:0}.wh-msg-thread-title{font-size:15px;font-weight:800;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wh-msg-thread-subtitle{color:var(--msg-muted);font-size:12px;margin:2px 0 0}.wh-msg-icon-btn{width:38px;height:38px;display:grid;place-items:center;border:0;border-radius:12px;background:transparent;color:var(--msg-ink);cursor:pointer}.wh-msg-icon-btn:hover{background:var(--msg-soft)}.wh-msg-back{display:none}
.wh-msg-thread-body{flex:1;min-height:150px;overflow-y:auto;display:flex;flex-direction:column;gap:11px;padding:22px 18px;overscroll-behavior:contain}.wh-msg-day{align-self:center;background:var(--msg-soft);color:var(--msg-muted);border-radius:20px;padding:6px 13px;font-size:11px;margin:8px 0}.wh-msg-bubble{max-width:min(85%,500px);min-width:85px;align-self:flex-start;border-radius:18px 18px 18px 5px;background:#f0f3f8;padding:12px 14px;overflow-wrap:anywhere;font-size:13px;line-height:1.55}.wh-msg-bubble.is-own{align-self:flex-end;border-radius:18px 18px 5px 18px;background:#e8edf9}.wh-msg-bubble.is-recalled{opacity:.7;font-style:italic}.wh-msg-bubble footer{display:flex;align-items:center;gap:5px;justify-content:flex-end;color:var(--msg-muted);font-size:10px;margin-top:6px}.wh-msg-bubble-menu{border:0;background:transparent;color:var(--msg-muted);padding:3px 5px;cursor:pointer}
.wh-msg-compose{display:flex;gap:9px;align-items:end;padding:14px;border-top:1px solid var(--msg-line);background:#fff}.wh-msg-input{min-width:0;flex:1;resize:vertical;max-height:120px;min-height:44px;border:1px solid var(--msg-line);border-radius:14px;padding:12px 14px;font:inherit;font-size:13px;outline:0}.wh-msg-input:focus{border-color:var(--msg-brand)}.wh-msg-send{width:44px;height:44px;border:0;border-radius:14px;background:var(--msg-brand);color:#fff;cursor:pointer}.wh-msg-no-reply{padding:17px;text-align:center;color:var(--msg-muted);font-size:12px;border-top:1px solid var(--msg-line)}
.wh-msg-typing{padding:8px 18px;color:var(--msg-muted);font-size:11px;display:flex;gap:5px;align-items:center}.wh-msg-typing span{width:6px;height:6px;border-radius:50%;background:#8392a8;animation:wh-msg-dot 1.1s infinite}.wh-msg-typing span:nth-child(2){animation-delay:.15s}.wh-msg-typing span:nth-child(3){animation-delay:.3s}@keyframes wh-msg-dot{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)}}
.wh-msg-empty{margin:auto;text-align:center;color:var(--msg-muted);padding:35px 18px}.wh-msg-empty>i{font-size:27px;color:#b4becd}.wh-msg-empty h3{font-size:15px;color:var(--msg-ink);margin:15px 0 5px}.wh-msg-empty p{font-size:12px;line-height:1.6}
.wh-msg-popover{position:fixed;z-index:10050;right:clamp(16px,5vw,65px);top:clamp(95px,15vh,150px);width:min(270px,calc(100vw - 32px));padding:7px;border:1px solid var(--msg-line);border-radius:15px;background:#fff;box-shadow:0 15px 50px rgba(22,36,60,.2)}.wh-msg-popover button{width:100%;border:0;background:#fff;text-align:left;padding:12px;border-radius:9px;display:flex;gap:12px;align-items:center;font-size:13px;color:var(--msg-ink);cursor:pointer}.wh-msg-popover button:hover{background:var(--msg-soft)}
.wh-msg-new{position:fixed;z-index:10060;inset:0;background:rgba(23,36,52,.45);display:grid;place-items:center;padding:18px}.wh-msg-new-card{width:min(520px,100%);max-height:85dvh;overflow-y:auto;background:#fff;border-radius:22px;padding:23px;box-shadow:0 25px 90px rgba(0,0,0,.2)}.wh-msg-new-top{display:flex;justify-content:space-between;align-items:center}.wh-msg-new-top h2{font-size:20px;margin:0}.wh-msg-new-form label:not(.wh-msg-person){display:block;margin:15px 0 7px;font-size:12px;font-weight:750}.wh-msg-new-form input[type=text],.wh-msg-new-form textarea,.wh-msg-new-form select{width:100%;padding:11px;border:1px solid #d8e0ea;border-radius:12px;background:#fff;color:var(--msg-ink)}.wh-msg-new-form textarea{min-height:110px}.wh-msg-people{max-height:180px;overflow-y:auto;border:1px solid var(--msg-line);border-radius:13px}.wh-msg-person{display:flex;align-items:center;gap:9px;padding:8px 11px;margin:0;border-bottom:1px solid var(--msg-line);font-size:12px}.wh-msg-person .wh-msg-avatar{width:28px;height:28px;flex-basis:28px;font-size:10px}.wh-msg-person input{accent-color:var(--msg-brand)}.wh-msg-new-form .wh-msg-primary{width:100%;margin-top:17px}
@media(max-width:700px){.wh-msg-header{margin-bottom:14px}.wh-msg-primary span{display:none}.wh-msg-layout{display:block;min-height:0}.wh-msg-inbox-panel,.wh-msg-thread-panel{height:calc(100dvh - 280px);min-height:390px;border-radius:18px}.wh-msg-thread-panel{display:none}.wh-msg-show-thread .wh-msg-inbox-panel{display:none}.wh-msg-show-thread .wh-msg-thread-panel{display:flex}.wh-msg-back{display:grid}.wh-msg-thread-body{padding:16px 12px}.wh-msg-bubble{max-width:88%}.wh-msg-new{align-items:end;padding:0}.wh-msg-new-card{width:100%;max-height:90dvh;border-radius:24px 24px 0 0;padding-bottom:calc(env(safe-area-inset-bottom) + 20px)}}
@media(prefers-reduced-motion:reduce){.wh-msg-typing span{animation:none}.wh-msg-row{transition:none}}

.wh-msg-attachments{display:flex;flex-wrap:wrap;gap:8px}.wh-msg-attachment-image img{max-width:230px;max-height:210px;border-radius:12px;object-fit:cover}.wh-msg-attachment-file{display:inline-flex;gap:6px;align-items:center;padding:9px;border-radius:9px;background:#fff;color:#405b7b;font-size:12px}.wh-msg-attach-label{cursor:pointer;flex:0 0 38px}.wh-msg-file-count{font-size:10px;color:var(--msg-muted);max-width:72px}

.wh-msg-original-toggle{border:0;background:transparent;color:#496c9e;padding:5px 0;font-size:11px;text-decoration:underline;cursor:pointer}

.wh-msg-select-all{float:right;background:transparent;border:0;color:var(--msg-brand);font-size:12px;font-weight:750;cursor:pointer}

/* Meddelanden 2.2: kompakt composer och modalens editor */
.wh-msg-compose{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:end;gap:8px}
.wh-msg-compose .wh-msg-upload-slot{min-width:40px;align-self:center}
.wh-msg-compose .wh-msg-input{width:100%;min-width:0}
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-list:not(:empty){position:absolute;bottom:calc(100% + 8px);left:0;width:min(300px,80vw);max-height:180px;overflow:auto;background:#fff;border:1px solid #e6ebf2;border-radius:12px;padding:7px;box-shadow:0 7px 25px rgba(0,0,0,.1);z-index:3}
.wh-msg-compose .wh-upload-composer-actions{position:absolute;bottom:calc(100% + 8px);left:0;padding:7px;border:1px solid #e6ebf2;border-radius:13px;background:#fff;box-shadow:0 7px 25px rgba(0,0,0,.1);z-index:4}
.wh-msg-new-upload{margin:12px 0 2px}
.wh-msg-new-upload .wh-upload-list:not(:empty){margin-top:10px}
.wh-msg-new-form .wh-msg-new-upload label.wh-upload-action{display:inline-flex;margin:0;font-size:12px;font-weight:600}
.wh-msg-new-form .wh-msg-new-upload label.wh-upload-action input{width:1px;padding:0;border:0}
.wh-msg-new-form .select2-container{width:100%!important}
.wh-msg-new-form .select2-container .select2-selection--single{height:46px;border:1px solid #d8e0ea;border-radius:12px;display:flex;align-items:center}
.wh-msg-new-form .select2-selection__rendered{padding-left:12px!important}
.wh-msg-new-form .select2-selection__arrow{top:50%!important;transform:translateY(-50%);right:9px!important}
.wh-msg-new-form .tox-tinymce{border:1px solid #d8e0ea;border-radius:12px;overflow:hidden}
.wh-msg-body p{margin:0 0 .55em}.wh-msg-body p:last-child{margin-bottom:0}.wh-msg-body ul,.wh-msg-body ol{padding-left:20px;margin:5px 0}.wh-msg-body a{color:#315a92;text-decoration:underline}
.wh-msg-compose.is-dragover,.wh-msg-new-card.is-dragover{outline:2px dashed #bf5b4a;outline-offset:-5px;background:#fff7f5}

/* Bilagor i skickade meddelanden: enhetliga 90 x 90-rutor */
.wh-msg-attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.wh-msg-attachment-preview{width:90px;height:90px;flex:0 0 90px;display:grid;place-items:center;border:0;border-radius:10px;overflow:hidden;background:#edf0f5;color:#6854a2;font-size:29px;cursor:pointer;padding:0}
.wh-msg-attachment-preview img{width:100%;height:100%;object-fit:cover;display:block}
.wh-msg-attachment-preview:hover,.wh-msg-attachment-preview:focus-visible{outline:2px solid #7154bb;outline-offset:2px}
.wh-msg-compose .wh-msg-upload-slot{align-self:center}
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-list:not(:empty){width:min(400px,85vw);max-height:220px}

/* 2.6: samma höjd och vertikal linje för alla kontroller, även utfällt gem. */
.wh-msg-compose{align-items:center!important;grid-template-columns:auto minmax(0,1fr) auto;gap:8px}
.wh-msg-compose .wh-msg-upload-slot{align-self:center!important;min-width:0}
.wh-msg-compose .wh-msg-input{height:44px;min-height:44px;box-sizing:border-box;align-self:center;margin:0;line-height:18px;padding:12px 13px}
.wh-msg-compose .wh-msg-send{height:44px;width:44px;min-width:44px;align-self:center;display:grid;place-items:center;padding:0;margin:0}
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-composer{height:44px;align-items:center}
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-composer-actions{align-items:center}
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-toggle,
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-action{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;margin:0!important;line-height:1;padding:0!important}
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-toggle i,
.wh-msg-compose .wh-upload[data-upload-mode="Composer"] .wh-upload-action i{font-size:14px;line-height:1}
.wh-msg-typing[hidden]{display:none!important}
.wh-msg-avatar{position:relative;overflow:hidden}
.wh-msg-avatar-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#f2d9bd}

/* 2.7 – stable viewport, contrasting bubbles, fixed composer */
.app-view[data-view="messages"] .wh-msg-layout{height:var(--wh-msg-viewport-height,calc(100dvh - 230px));min-height:0;max-height:var(--wh-msg-viewport-height,calc(100dvh - 230px));overflow:hidden}
.app-view[data-view="messages"] .wh-msg-inbox-panel,.app-view[data-view="messages"] .wh-msg-thread-panel{height:100%;min-height:0;max-height:100%}
.app-view[data-view="messages"] .wh-msg-thread-body{min-height:0;overflow-y:auto;overflow-x:hidden;overflow-anchor:none;scroll-behavior:auto}
.app-view[data-view="messages"] .wh-msg-inbox-list{min-height:0}
.app-view[data-view="messages"] .wh-msg-bubble.is-own{background:#faeae6;color:#382a2b}
.app-view[data-view="messages"] .wh-msg-bubble.is-other{background:#eef1f5;color:#263342}
.app-view[data-view="messages"] .wh-msg-compose{flex-shrink:0}
.app-view[data-view="messages"] .wh-msg-typing{flex-shrink:0;min-height:30px}
@media(max-width:700px){.app-view[data-view="messages"] .wh-msg-layout{display:block;height:var(--wh-msg-viewport-height,calc(100dvh - 230px));min-height:0;max-height:var(--wh-msg-viewport-height,calc(100dvh - 230px))}.app-view[data-view="messages"] .wh-msg-inbox-panel,.app-view[data-view="messages"] .wh-msg-thread-panel{height:100%;min-height:0;max-height:100%}.app-view[data-view="messages"] .wh-msg-thread-panel{display:none}.app-view[data-view="messages"].wh-msg-show-thread .wh-msg-thread-panel{display:flex}}

.app-view[data-view="messages"] .wh-msg-typing .wh-msg-typing-name{width:auto;height:auto;border-radius:0;background:transparent;animation:none;transform:none;font-size:11px}

/* 3.0: global profilnotis och korrekt Select2-pil */
.js-message-avatar-badge{right:-3px;top:-3px;min-width:17px;height:17px;padding:0 4px;line-height:17px;font-size:10px;box-shadow:0 0 0 2px #fff}
.wh-msg-new-form .select2-container .select2-selection--single .select2-selection__arrow{top:50%!important;transform:translateY(-50%);height:20px}

/* Meddelanden 3.2: kompakt TinyMCE, formatering visas vid behov. */
.wh-msg-new-form .wh-msg-format-toggle{display:inline-flex;align-items:center;gap:8px;margin:0 0 9px;padding:6px 10px;border:1px solid #e4e8ee;border-radius:9px;background:#fff;color:#344254;font:inherit;font-size:12px;cursor:pointer}
.wh-msg-new-form .wh-msg-format-toggle:hover{background:#f5f7fa}
.wh-msg-new-form .wh-msg-format-toggle .wh-msg-format-chevron{font-size:10px;transition:transform .15s}
.wh-msg-new-card.wh-msg-format-visible .wh-msg-format-chevron{transform:rotate(180deg)}
.wh-msg-new-card:not(.wh-msg-format-visible) .tox:not(.tox-tinymce-inline) .tox-editor-header{display:none!important}
.wh-msg-new-form .tox:not(.tox-tinymce-inline) .tox-editor-header{background:#fff!important;background-image:none!important;border-bottom:1px solid #eee!important;box-shadow:none!important;padding:4px 0!important}
.wh-msg-new-form .tox:not(.tox-tinymce-inline) .tox-toolbar-overlord,
.wh-msg-new-form .tox:not(.tox-tinymce-inline) .tox-toolbar__primary{background:#fff!important;background-image:none!important;box-shadow:none!important}

/* 3.3: indikatorn ligger utanför .avatar eftersom workhouse.js ersätter knappens innehåll vid profiluppdatering. */
.wh-profile-avatar-wrap{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;overflow:visible}
.wh-profile-avatar-wrap>.js-message-avatar-badge{position:absolute;top:-5px;right:-6px;display:block;pointer-events:none;z-index:50;min-width:19px;height:19px;padding:0 4px;box-sizing:border-box;border-radius:99px;background:#c43c36;color:#fff;text-align:center;font:700 11px/19px Arial,sans-serif;box-shadow:0 0 0 2px #fff}
.wh-profile-avatar-wrap>.js-message-avatar-badge[hidden]{display:none!important}
.wh-msg-system-photo{background:#bd5949}

/* 3.4: diskret systemikon och egna redigera-/bekräftelsedialoger. */
.wh-msg-system-photo{background:#bd5949}
.wh-msg-action-dialog{position:fixed;inset:0;z-index:10080;display:grid;place-items:center;padding:18px}
.wh-msg-action-dialog[hidden]{display:none!important}
.wh-msg-action-backdrop{position:absolute;inset:0;background:rgba(23,36,52,.5)}
.wh-msg-action-form{position:relative;width:min(520px,100%);max-height:calc(100dvh - 36px);overflow-y:auto;background:#fff;border-radius:20px;padding:22px;box-shadow:0 24px 85px rgba(0,0,0,.22);color:#1d2b3b}
.wh-msg-action-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.wh-msg-action-title{font-size:19px;font-weight:800;margin:0}
.wh-msg-action-close{border:0;background:#f2f5fa;width:34px;height:34px;border-radius:10px;cursor:pointer;color:#344254}
.wh-msg-action-description{font-size:13px;line-height:1.6;color:#667386;margin:14px 0 18px}
.wh-msg-action-editor{display:none}
.wh-msg-action-dialog.is-edit .wh-msg-action-editor{display:block}
.wh-msg-action-editor textarea{width:100%;min-height:200px;border:1px solid #d8e0ea;border-radius:12px;padding:12px;font:inherit;font-size:14px}
.wh-msg-action-editor .tox-tinymce{border:1px solid #d8e0ea;border-radius:12px;overflow:hidden}
.wh-msg-action-editor .tox-editor-header,.wh-msg-action-editor .tox-toolbar-overlord,.wh-msg-action-editor .tox-toolbar__primary{background:#fff!important;background-image:none!important;box-shadow:none!important}
.wh-msg-action-error{color:#ad263b;font-size:12px;margin:9px 0}
.wh-msg-action-error:empty{display:none}
.wh-msg-action-buttons{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}
.wh-msg-action-secondary,.wh-msg-action-submit{min-height:43px;padding:0 17px;border-radius:11px;font-weight:700;cursor:pointer}
.wh-msg-action-secondary{border:1px solid #e2e7ee;background:#fff;color:#344254}
.wh-msg-action-submit{border:0;background:#bf5b4a;color:#fff}
.wh-msg-action-submit:disabled{opacity:.6;cursor:wait}
@media(max-width:700px){.wh-msg-action-dialog{align-items:end;padding:0}.wh-msg-action-form{width:100%;max-height:90dvh;border-radius:22px 22px 0 0;padding:22px 18px calc(22px + env(safe-area-inset-bottom))}}

/* Workhour – nytt meddelande: verktyg under textrutan. */
.wh-msg-new-form .wh-msg-new-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin-top: 5px;
}
.wh-msg-new-form .wh-msg-new-tools > .wh-msg-new-upload {
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
}
.wh-msg-new-form .wh-msg-new-tools > .wh-msg-format-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  max-width: 100%;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 11px;
  margin: 0;
  white-space: nowrap;
}
/* Den gemensamma bildvisaren måste ligga ovanför meddelandets modal och overlay. */
#mediaPreviewDialog.media-preview-dialog {
  z-index: 1000000 !important;
}

/* Workhour: meddelandelayout – höjd vid växling mellan mobil och dator.
   JS sätter --wh-msg-viewport-height utifrån tillgängligt utrymme. */
@media (min-width: 1100px) {
  .app-view[data-view="messages"] .wh-msg-layout {
    min-height: 0;
  }
}

/* Workhour – kompakt inkorg, markeringsläge och gemensam trepricksmeny. */
.wh-msg-inbox-head{padding-bottom:8px}
.wh-msg-filterbar{display:flex;align-items:center;gap:4px;min-width:0}
.wh-msg-filterbar .wh-msg-filters{flex:1;min-width:0;padding:9px 0 1px;gap:2px}
.wh-msg-filterbar .wh-msg-filters button{padding:7px 9px}
.wh-msg-inbox-tools{display:flex;align-items:center;flex:0 0 auto;gap:4px}
.wh-msg-selected-status{font-size:11px;color:var(--msg-muted);white-space:nowrap}
.wh-msg-inbox-menu{border:0;background:transparent;color:var(--msg-ink);width:32px;height:34px;display:grid;place-items:center;border-radius:9px;cursor:pointer;font-size:15px}
.wh-msg-inbox-menu:hover,.wh-msg-inbox-menu:focus-visible{background:var(--msg-soft)}
.wh-msg-swipe .wh-msg-row{padding:11px 12px 11px 42px;gap:10px;min-height:73px;align-items:center}
.wh-msg-swipe .wh-msg-avatar{width:38px;height:38px;flex-basis:38px}
.wh-msg-swipe .wh-msg-preview{margin-top:2px;line-height:1.35;-webkit-line-clamp:1;line-clamp:1}
.wh-msg-swipe .wh-msg-kind{margin-top:3px;line-height:1.2}
.wh-msg-swipe .wh-msg-row-side{gap:5px;align-self:flex-start;margin-top:2px}
.wh-msg-select-row{position:absolute;left:7px;top:50%;transform:translateY(-50%);z-index:3;width:28px;height:34px;display:grid;place-items:center;border:0;background:transparent;color:#9aa6b5;border-radius:8px;cursor:pointer}
.wh-msg-select-row:hover,.wh-msg-select-row[aria-pressed="true"]{color:var(--msg-brand);background:var(--msg-soft)}
.wh-msg-swipe.is-selected .wh-msg-row{background:#f2f5fb}
.wh-msg-popover button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:460px){.wh-msg-filterbar .wh-msg-filters button{padding:7px 7px;font-size:11px}.wh-msg-selected-status{font-size:10px}.wh-msg-inbox-head{padding-left:12px;padding-right:12px}}


/* WORKHOUR message.css 3.0.4 · 2026-10-02
   Systemfel visas som read-only systemmeddelanden med tydlig teknisk kodplatta. */
.wh-msg-bubble.is-system{max-width:min(96%,820px);background:#f3f5f8;border:1px solid #d8dee8;color:#1e293b}
.wh-msg-bubble.is-system .wh-msg-body pre{margin:10px 0 0;padding:14px 16px;border-radius:12px;background:#111827;color:#e5e7eb;overflow:auto;white-space:pre-wrap;word-break:break-word;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace}
.wh-msg-bubble.is-system .wh-msg-body code{font:inherit;color:inherit}
.wh-msg-bubble.is-system .wh-msg-bubble-menu{display:none}


/* WORKHOUR message.css 3.0.6 · 2026-10-02
   Systemfel: bibehållen kodformatering och svagt röd felbakgrund. */
.wh-msg-bubble.is-system{max-width:min(96%,820px);background:#fff5f4;border:1px solid #f0cbc6;color:#1e293b}
.wh-msg-bubble.is-system .wh-msg-body pre{margin:10px 0 0;padding:14px 16px;border-radius:12px;background:#111827;color:#e5e7eb;overflow:auto;white-space:pre-wrap;word-break:break-word;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace}
.wh-msg-bubble.is-system .wh-msg-body code{font:inherit;color:inherit;white-space:inherit}
.wh-msg-bubble.is-system .wh-msg-bubble-menu{display:none}
