.im-bell { position: relative; border: 0; background: transparent; color: inherit; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 20px; }
.im-bell:focus-visible, #internal-message-panel button:focus-visible, #im-divider:focus-visible { outline: 3px solid #618bfa; outline-offset: 2px; }
.im-badge { position: absolute; top: 1px; right: 0; min-width: 19px; padding: 2px 4px; border-radius: 12px; background: #cf2438; color: white; font: 600 11px/1.3 sans-serif; }
.im-badge[hidden], #internal-message-panel[hidden], #im-divider[hidden] { display: none !important; }
body.im-open .pcoded-main-container { margin-right: var(--im-width, 440px); width: auto; min-width: 0; transition: none; }
body.im-open .pcoded-header { width: calc(100% - var(--im-width, 440px)); transition: none; }
#internal-message-panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--im-width, 440px); z-index: 1040; background: #fff; color: #24354b; display: flex; flex-direction: column; box-shadow: -4px 0 18px #20375b18; font: 14px/1.55 "Microsoft YaHei", sans-serif; text-align: left; }
#internal-message-panel *, #im-divider { box-sizing: border-box; }
#im-divider { position: fixed; right: calc(var(--im-width, 440px) - 4px); top: 0; bottom: 0; width: 8px; z-index: 1041; cursor: col-resize; touch-action: none; background: linear-gradient(to right, transparent 3px, #bac5d3 3px, #bac5d3 4px, transparent 4px); }
#im-divider::after { content: "⋮"; position: absolute; top: 48%; left: -3px; color: #526783; background: #e9eef5; border-radius: 6px; width: 13px; text-align: center; }
body.im-resizing { cursor: col-resize; user-select: none; }
#internal-message-panel .im-header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid #dfe6ef; flex: 0 0 auto; }
#internal-message-panel .im-header h2 { font-size: 18px; margin: 0 auto 0 0; color: inherit; }
#internal-message-panel button { font: inherit; cursor: pointer; border: 1px solid #ccd6e3; border-radius: 6px; padding: 6px 10px; background: white; color: #284460; white-space: normal; }
#internal-message-panel button:disabled { cursor: not-allowed; opacity: .55; }
#internal-message-panel button.im-primary { background: #315ed1; border-color: #315ed1; color: white; }
#internal-message-panel button.im-danger { color: #a71f32; }
#internal-message-panel button.im-icon { border: 0; padding: 4px 8px; min-width: 36px; min-height: 36px; font-size: 23px; }
#internal-message-panel .im-status { padding: 7px 16px; font-size: 12px; color: #697c92; background: #f6f8fb; overflow-wrap: anywhere; flex: 0 0 auto; }
#internal-message-panel .im-status.im-error { background: #fff1ef; color: #a52c32; }
#internal-message-panel .im-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; }
#internal-message-panel .im-tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 8px; }
#internal-message-panel .im-tabs button { flex: 0 0 auto; }
#internal-message-panel .im-tabs button[aria-pressed="true"] { color: #244eb8; border-color: #7699e9; background: #eef4ff; }
#internal-message-panel label { display: block; margin: 10px 0 5px; color: #344964; }
#internal-message-panel input:not([type=checkbox]):not([type=file]), #internal-message-panel select, #internal-message-panel textarea { width: 100%; min-width: 0; border: 1px solid #cbd5e3; border-radius: 6px; padding: 8px 10px; background: #fff; color: #24354b; font: inherit; }
#internal-message-panel input[type=checkbox] { margin-right: 5px; accent-color: #315ed1; }
#internal-message-panel textarea { min-height: 160px; resize: vertical; }
#internal-message-panel .im-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 10px 0; }
#internal-message-panel .im-row > label { margin: 0; }
#internal-message-panel .im-list { margin: 10px 0; }
#internal-message-panel .im-thread { display: block; text-align: left; width: 100%; margin-bottom: 8px; padding: 12px; overflow-wrap: anywhere; }
#internal-message-panel .im-thread strong { display: block; font-weight: 500; }
#internal-message-panel .im-thread.im-unread { background: #f0f5ff; border-left: 3px solid #315ed1; }
#internal-message-panel .im-thread.im-unread strong { font-weight: 700; }
#internal-message-panel small { font-size: 12px; color: #697c92; }
#internal-message-panel .im-meta { font-size: 12px; color: #697c92; overflow-wrap: anywhere; }
#internal-message-panel .im-subject { font-size: 18px; overflow-wrap: anywhere; margin: 12px 0; }
#internal-message-panel .im-note { border-left: 3px solid #7196db; padding: 9px 12px; background: #f1f6ff; overflow-wrap: anywhere; }
#internal-message-panel .im-post { margin: 14px 0; border: 1px solid #d9e3ef; border-radius: 8px; padding: 12px; background: #fff; }
#internal-message-panel .im-post.im-mine { background: #f2f6fc; }
#internal-message-panel .im-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 9px 0; }
#internal-message-panel .im-file { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #e5ebf3; overflow-wrap: anywhere; }
#internal-message-panel .im-file .im-file-preview { min-width: 0; flex: 1; text-align: left; color: #2757bd; overflow-wrap: anywhere; border: 0; background: transparent; padding: 4px 0; }
#internal-message-panel .im-file .im-file-thumb { flex: 0 0 64px; border: 0; background: transparent; padding: 0; }
#internal-message-panel .im-file .im-file-download { flex: 0 0 auto; color: #2757bd; padding: 8px 0; }
#internal-message-panel .im-file img { width: 64px; height: 64px; object-fit: contain; border: 1px solid #e0e6ef; border-radius: 4px; flex: 0 0 64px; }
#internal-message-panel .im-compose-actions { position: sticky; bottom: -14px; background: white; border-top: 1px solid #dce4ee; padding: 12px 0; margin-top: 16px; }
#internal-message-panel .im-users { border: 1px solid #dce4ee; padding: 8px 10px; max-height: 240px; overflow-y: auto; border-radius: 6px; }
#internal-message-panel .im-users details { padding: 5px 0; }
#internal-message-panel .im-users summary { cursor: pointer; font-weight: 600; }
#internal-message-panel .im-user { display: inline-flex; gap: 4px; align-items: center; min-height: 32px; margin: 2px 12px 2px 0; font-weight: normal; }
#internal-message-panel .im-user[hidden], #internal-message-panel details[hidden] { display: none; }
#internal-message-panel .im-selected { color: #365ec0; }
#internal-message-panel fieldset { min-width: 0; padding: 0; border: 0; }
#internal-message-panel .im-drop { border: 1px dashed #8eaad5; padding: 12px; border-radius: 6px; background: #f7faff; }
#internal-message-panel .im-drop.im-dragover { background: #e4eeff; }
#internal-message-panel .im-empty { text-align: center; padding: 30px 8px; color: #6e829b; }
.swal2-container.im-swal-container { z-index: 1090; }
.im-swal-container .swal2-title, .im-swal-container .swal2-html-container { overflow-wrap: anywhere; min-width: 0; }
.im-preview-popup .swal2-title { font-size: 1.25rem; padding-right: 2rem; }
.im-preview-popup .swal2-html-container { margin: 1rem; }
.im-attachment-viewer { min-width: 0; text-align: left; font-size: 14px; }
.im-attachment-viewer .im-preview-meta, .im-attachment-viewer .im-preview-note { color: #697c92; margin: 0 0 10px; }
.im-attachment-viewer .im-preview-error { color: #a52c32; }
.im-attachment-viewer .im-preview-stage { max-height: 65vh; max-height: 65dvh; overflow: auto; text-align: center; }
.im-preview-stage img { display: block; margin: auto; max-width: 100%; max-height: 65vh; max-height: 65dvh; object-fit: contain; }
.im-preview-stage.im-preview-original img { max-width: none; max-height: none; }
.im-preview-stage video { display: block; width: 100%; max-height: 65vh; max-height: 65dvh; background: #111; }
.im-preview-stage iframe { display: block; width: 100%; height: 65vh; height: 65dvh; border: 1px solid #dce4ee; background: white; }
.im-preview-stage pre { margin: 0; padding: 12px; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f8fb; color: #24354b; }
.im-preview-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.im-preview-tools .btn { min-height: 40px; }
@media (max-width: 991px) {
    .pcoded-header .m-header > .im-bell { position: absolute; right: 54px; top: 3px; color: inherit; }
    body.im-open .pcoded-main-container { margin-right: 0; }
    body.im-open .pcoded-header { width: 100%; }
    body.im-open { overflow: hidden; }
    #internal-message-panel { width: 100%; height: 100dvh; z-index: 1050; }
    #im-divider { display: none; }
    #internal-message-panel button { min-height: 40px; }
    #internal-message-panel input:not([type=checkbox]):not([type=file]), #internal-message-panel select, #internal-message-panel textarea { font-size: 16px; }
    #internal-message-panel .im-header { padding: 10px 12px; }
    #internal-message-panel .im-scroll { padding: 12px; }
}
