.communication-page-head.workpaper-page-head {
    display: grid;
    grid-template-columns: max-content minmax(300px, 430px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 13px;
    margin-bottom: 14px !important;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: 10px;
    box-shadow: var(--fd-shadow);
}

.communication-page-head .topbar {
    margin: 0;
}

.communication-page-head .topbar-title h2 {
    margin: 0;
    white-space: nowrap;
}

.communication-page-head .communication-tabs {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: none;
    width: 100%;
    margin: 0 !important;
}

.communication-header-slot {
    min-width: 0;
}

.communication-header-slot .workpaper-header-card {
    display: none !important;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.communication-header-slot .workpaper-header-card.is-active {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.communication-header-slot .workpaper-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.communication-header-slot .workpaper-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 18px;
}

.communication-header-slot .workpaper-title > div:last-child {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.communication-header-slot .workpaper-title h2 {
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
}

.communication-header-slot .topbar-subtitle {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.communication-pane.is-active {
    margin-top: 0;
}

.flowmessage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 14px;
    width: 100%;
    --flowmessage-chat-width: min(920px, 100%);
}

.flowmessage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    background: #ffffff;
}

.flowmessage-kicker {
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.flowmessage-head h2 {
    margin: 2px 0 0;
    font-size: 22px;
}

.flowmessage-head p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 13px;
}

.flowmessage-head-actions,
.flowmessage-compose-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.flowmessage-grid {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 14px;
    min-height: 660px;
}

.flowmessage-sidebar,
.flowmessage-main,
.flowmessage-compose,
.flowmessage-detail {
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    background: #ffffff;
}

.flowmessage-sidebar {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
}

.flowmessage-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.flowmessage-user > div,
.flowmessage-user > span:not(.flowmessage-avatar) {
    min-width: 0;
    max-width: 100%;
}

.flowmessage-user strong,
.flowmessage-user small {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-user small {
    color: #64748b;
}

.flowmessage-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 900;
    overflow: hidden;
}

.flowmessage-mailboxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 4px;
    border: 1px solid #dbe7f5;
    border-radius: 10px;
    background: #f8fbff;
}

.flowmessage-mailboxes button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-size: 12px;
    font-weight: 750;
}

.flowmessage-mailboxes button.is-active {
    background: #2563eb;
    color: #ffffff;
}

.flowmessage-mailboxes span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-size: 11px;
}

.flowmessage-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid #cddcf0;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
}

.flowmessage-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 13px;
}

.flowmessage-thread-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow: auto;
}

.flowmessage-thread {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    align-items: start;
    gap: 8px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    background: #ffffff;
    text-align: left;
}

.flowmessage-thread-open {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.flowmessage-thread-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    opacity: .72;
}

.flowmessage-thread-delete:hover,
.flowmessage-thread-delete:focus-visible {
    border-color: #fecaca;
    background: #fff7f7;
    color: #dc2626;
    opacity: 1;
    outline: none;
}

.flowmessage-draft {
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: stretch;
    gap: 8px;
}

.flowmessage-draft-open {
    display: grid;
    gap: 7px;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    text-align: left;
}

.flowmessage-draft-trash {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    align-self: start;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
    color: #dc2626;
}

.flowmessage-draft-trash:hover,
.flowmessage-draft-trash:focus-visible {
    border-color: #ef4444;
    background: #fee2e2;
    outline: none;
}

.flowmessage-thread:hover,
.flowmessage-thread:focus-within {
    border-color: #93c5fd;
    background: #f8fbff;
}

.flowmessage-thread.is-active {
    border-color: #2563eb;
    background: #eff6ff;
}

.flowmessage-thread.has-unread {
    border-color: #bfdbfe;
    box-shadow: inset 3px 0 0 #2563eb;
}

.flowmessage-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.flowmessage-thread-title-wrap,
.flowmessage-detail-title-wrap {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.flowmessage-thread-avatar,
.flowmessage-detail-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: #e0ecff;
    color: #1d4ed8;
    font-weight: 900;
    overflow: hidden;
}

.flowmessage-avatar.has-image,
.flowmessage-thread-avatar.has-image,
.flowmessage-detail-avatar.has-image {
    background: #ffffff;
    color: transparent;
}

.flowmessage-avatar img,
.flowmessage-thread-avatar img,
.flowmessage-detail-avatar img {
    width: 200%;
    height: 200%;
    object-fit: cover;
    object-position: center top;
    transform: translateX(-25%);
    transform-origin: center top;
    display: block;
}

.flowmessage-avatar.photo-focus-right img,
.flowmessage-thread-avatar.photo-focus-right img,
.flowmessage-detail-avatar.photo-focus-right img {
    object-position: 72% 18%;
    transform: scale(1.24);
    transform-origin: 72% 18%;
}

.flowmessage-avatar.photo-focus-head img,
.flowmessage-thread-avatar.photo-focus-head img,
.flowmessage-detail-avatar.photo-focus-head img {
    width: 252%;
    height: 252%;
    object-position: center top;
    transform: translate(-1%, 34%);
    transform-origin: center top;
}

.flowmessage-thread-avatar {
    width: 40px;
    height: 40px;
    font-size: 12px;
}

.flowmessage-detail-avatar {
    width: 54px;
    height: 54px;
    font-size: 14px;
}

.flowmessage-thread-name {
    min-width: 0;
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-thread-time {
    color: #64748b;
    font-size: 12px;
}

.flowmessage-thread-preview {
    display: grid;
    gap: 2px;
    overflow: hidden;
}

.flowmessage-thread-subject,
.flowmessage-thread-snippet {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-thread-subject {
    color: #475569;
    font-size: 11px;
    font-weight: 750;
}

.flowmessage-thread-snippet {
    color: #0f172a;
    font-size: 12px;
    font-weight: 850;
}

.flowmessage-thread-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.flowmessage-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

.flowmessage-priority {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #b45309;
}

.flowmessage-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    background: #f8fbff;
}

.flowmessage-compose {
    padding: 14px;
    border: 1px solid #dbe7f5;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .045);
}

.flowmessage-section-title,
.flowmessage-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.flowmessage-detail-head {
    align-items: stretch;
    flex-direction: column;
    padding-bottom: 12px;
    border-bottom: 1px solid #e3edfb;
}

.flowmessage-section-title span,
.flowmessage-detail-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 850;
}

.flowmessage-detail-meta {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.flowmessage-detail-subject {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.flowmessage-detail-subject-label {
    color: #2563eb;
    font-size: 12px;
    font-weight: 850;
}

.flowmessage-compose-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(230px, .34fr);
    gap: 12px;
}

.flowmessage-context {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 12px;
    padding: 7px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.2;
}

.flowmessage-context strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.flowmessage-thread-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #c7d9f5;
    border-radius: 8px;
    background: #f8fbff;
    color: #1e3a8a;
}

.flowmessage-thread-context > span {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    font-size: 12px;
}

.flowmessage-thread-context strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.flowmessage-compose-field,
.flowmessage-compose-grid > label {
    display: grid;
    gap: 5px;
    margin: 0;
}

.flowmessage-compose-field > span,
.flowmessage-compose-grid > label > span,
.flowmessage-field-head > span {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.flowmessage-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.flowmessage-self-note {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    min-height: 30px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid #c9dbf4;
    border-radius: 8px;
    background: #f8fbff;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.flowmessage-self-note input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.flowmessage-self-note i {
    color: #2563eb;
    font-size: 14px;
}

.flowmessage-self-note:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.flowmessage-recipient-picker {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
    padding: 5px;
    border: 1px solid #d7e3f3;
    border-radius: 9px;
    background: #fbfdff;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.flowmessage-recipient-picker:focus-within {
    border-color: #93b7f4;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.flowmessage-recipient-picker.is-disabled {
    opacity: .62;
    background: #f1f5f9;
}

.flowmessage-recipient-selected {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 0;
    min-height: 32px;
    max-width: 100%;
}

.flowmessage-recipient-selected:empty {
    display: none;
}

.flowmessage-recipient-placeholder {
    padding-left: 7px;
    color: #8aa0bb;
    font-size: 12px;
    font-weight: 600;
}

.flowmessage-recipient-chip {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    gap: 6px;
    min-height: 28px;
    padding: 3px 5px 3px 4px;
    border: 1px solid #c7dcfb;
    border-radius: 999px;
    background: #eef6ff;
    color: #17325f;
    font-size: 12px;
    font-weight: 750;
}

.flowmessage-recipient-person-code,
.flowmessage-recipient-role-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 22px;
    flex: 0 0 auto;
    padding: 2px 8px;
    border: 1px solid rgba(37, 99, 235, .22);
    border-radius: 999px;
    line-height: 1;
    font-size: 10px;
    font-weight: 900;
}

.flowmessage-recipient-person-code {
    background: #2563eb;
    color: #ffffff;
}

.flowmessage-recipient-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-recipient-role-pill {
    border-color: rgba(5, 150, 105, .22);
    background: #ecfdf5;
    color: #047857;
}

.flowmessage-recipient-role-pill.is-fuehrung {
    border-color: rgba(124, 58, 237, .22);
    background: #f5f3ff;
    color: #6d28d9;
}

.flowmessage-recipient-role-pill.is-assistenz {
    border-color: rgba(217, 119, 6, .24);
    background: #fffbeb;
    color: #b45309;
}

.flowmessage-recipient-role-pill.is-admin {
    border-color: rgba(15, 23, 42, .18);
    background: #f1f5f9;
    color: #334155;
}

.flowmessage-recipient-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
}

.flowmessage-recipient-chip button:hover,
.flowmessage-recipient-chip button:focus-visible {
    background: #dbeafe;
    color: #1d4ed8;
}

.flowmessage-recipient-input {
    flex: 1 1 180px;
    min-width: 180px;
    width: auto;
    min-height: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #ffffff;
    color: #172033;
    font-size: 13px;
    outline: none;
}

.flowmessage-recipient-input:focus {
    border-color: #dbeafe;
}

.flowmessage-recipient-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    display: grid;
    gap: 4px;
    max-height: 274px;
    overflow: auto;
    padding: 6px;
    border: 1px solid #cfe0f5;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
}

.flowmessage-recipient-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #172033;
    text-align: left;
}

.flowmessage-recipient-option:hover,
.flowmessage-recipient-option:focus-visible {
    background: #eff6ff;
}

.flowmessage-recipient-option-main {
    display: grid;
    min-width: 0;
}

.flowmessage-recipient-option-main strong,
.flowmessage-recipient-option-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-recipient-option-main strong {
    font-size: 13px;
    font-weight: 800;
}

.flowmessage-recipient-option-main small,
.flowmessage-recipient-empty {
    color: #64748b;
    font-size: 12px;
}

.flowmessage-recipient-empty {
    padding: 10px;
}

.flowmessage-priority-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    min-height: 44px;
    padding: 5px;
    border: 1px solid #d7e3f3;
    border-radius: 9px;
    background: #fbfdff;
}

.flowmessage-priority-toggle button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.flowmessage-priority-toggle button.is-active {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .18);
}

.flowmessage-priority-toggle button:not(.is-active):hover,
.flowmessage-priority-toggle button:not(.is-active):focus-visible {
    background: #eff6ff;
    color: #1d4ed8;
}

.flowmessage-wide {
    grid-column: 1 / -1;
}

.flowmessage-compose-actions {
    margin-top: 12px;
}

.flowmessage-confirm-modal .modal-title {
    color: #0f172a;
    font-weight: 800;
}

.flowmessage-reply-box {
    display: grid;
    gap: 9px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
}

.flowmessage-reply-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 800;
}

.flowmessage-reply-head small {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.flowmessage-reply-grid {
    display: grid;
    gap: 8px;
}

.flowmessage-file-control {
    display: grid;
    gap: 7px;
    margin: 0;
}

.flowmessage-file-control > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}

.flowmessage-file-control .form-control {
    min-height: 40px;
    height: 40px;
    padding: 0 12px 0 0;
    line-height: normal;
}

.flowmessage-file-control input[type="file"].form-control::file-selector-button {
    height: 40px;
    margin: -1px 10px -1px 0;
    padding: 0 14px;
    line-height: 38px;
}

.flowmessage-file-control input[type="file"].form-control::-webkit-file-upload-button {
    height: 40px;
    margin: -1px 10px -1px 0;
    padding: 0 14px;
    line-height: 38px;
}

.flowmessage-detail {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 14px;
}

.flowmessage-detail-head,
.flowmessage-stream,
.flowmessage-reply-box {
    width: var(--flowmessage-chat-width);
    max-width: var(--flowmessage-chat-width);
}

.flowmessage-stream {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    overflow: auto;
}

.flowmessage-bubble {
    max-width: min(680px, 86%);
    padding: 10px 12px;
    border: 1px solid #dbe7f5;
    border-radius: 12px;
    background: #ffffff;
}

.flowmessage-bubble.is-own {
    justify-self: end;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.flowmessage-bubble.is-self-note {
    border-color: #c7d2fe;
    background: #f5f7ff;
}

.flowmessage-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.flowmessage-bubble-body {
    margin-top: 5px;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.flowmessage-message-label,
.flowmessage-self-note-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.flowmessage-message-label {
    margin-top: 7px;
    margin-bottom: 2px;
    padding: 5px 8px;
}

.flowmessage-self-note-badge {
    padding: 3px 7px;
}

.flowmessage-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.flowmessage-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 0;
}

.flowmessage-file-list:empty {
    display: none;
}

.flowmessage-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 260px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f8fbff;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-attachment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 260px;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.flowmessage-attachment span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flowmessage-attachment:hover {
    border-color: #2563eb;
    color: #1d4ed8;
}

.flowmessage-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 18px;
    color: #64748b;
    text-align: center;
}

.flowmessage-empty.is-large {
    min-height: 420px;
}

.flowmessage-empty i {
    color: #2563eb;
    font-size: 28px;
}

.self-notes-modal {
    overflow: hidden;
    border: 1px solid #dbe6f2;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.self-notes-modal .modal-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e4edf8;
}

.self-notes-modal .modal-title {
    font-size: 18px;
    font-weight: 820;
    letter-spacing: 0;
}

.self-notes-modal .modal-body {
    display: grid;
    gap: 10px;
    padding: 16px 18px 18px;
    background: #f8fbff;
}

.self-note-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dbe7f7;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .045);
    transition: opacity .16s ease, transform .16s ease;
}

.self-note-open {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
}

.self-note-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
}

.self-note-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.self-note-title {
    overflow: hidden;
    color: #0f172a;
    font-size: 14px;
    font-weight: 780;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.self-note-body {
    display: -webkit-box;
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.self-note-check {
    align-self: center;
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.self-note-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.self-note-check span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 96px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #c7dcfb;
    border-radius: 8px;
    background: #f8fbff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 760;
    line-height: 1;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.self-note-check span i {
    font-size: 14px;
}

.self-note-check:hover span,
.self-note-check input:focus-visible + span {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.self-note-check input:checked + span {
    border-color: #16a34a;
    background: #dcfce7;
    color: #15803d;
}

.self-note-row.is-completing {
    opacity: .62;
    transform: none;
}

.self-note-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 28px 12px;
    text-align: center;
}

.self-note-empty i {
    color: #2563eb;
    font-size: 24px;
}

.self-note-empty strong {
    color: #0f172a;
}

body.darkmode .flowmessage-head,
body.darkmode .flowmessage-sidebar,
body.darkmode .flowmessage-main,
body.darkmode .flowmessage-compose,
body.darkmode .flowmessage-detail {
    border-color: #24324a;
    background: #0f172a;
    color: #e5e7eb;
}

body.darkmode .flowmessage-main,
body.darkmode .flowmessage-mailboxes {
    background: #111827;
}

body.darkmode .flowmessage-head p,
body.darkmode .flowmessage-user small,
body.darkmode .flowmessage-thread-time,
body.darkmode .flowmessage-thread-preview,
body.darkmode .flowmessage-thread-meta,
body.darkmode .flowmessage-detail-meta,
body.darkmode .flowmessage-empty,
body.darkmode .flowmessage-compose-grid label > span,
body.darkmode .flowmessage-reply-head small,
body.darkmode .flowmessage-bubble-head {
    color: #9ca3af;
}

body.darkmode .flowmessage-kicker,
body.darkmode .flowmessage-empty i {
    color: #93c5fd;
}

body.darkmode .flowmessage-avatar {
    background: #172554;
    color: #bfdbfe;
}

body.darkmode .flowmessage-mailboxes,
body.darkmode .flowmessage-search,
body.darkmode .flowmessage-thread,
body.darkmode .flowmessage-draft-open,
body.darkmode .flowmessage-compose,
body.darkmode .flowmessage-bubble,
body.darkmode .flowmessage-reply-box,
body.darkmode .flowmessage-context,
body.darkmode .flowmessage-thread-context,
body.darkmode .flowmessage-detail-subject,
body.darkmode .flowmessage-self-note,
body.darkmode .flowmessage-recipient-picker,
body.darkmode .flowmessage-priority-toggle,
body.darkmode .flowmessage-message-label,
body.darkmode .flowmessage-self-note-badge,
body.darkmode .flowmessage-file-chip,
body.darkmode .flowmessage-attachment {
    border-color: #334155;
    background: #111827;
}

body.darkmode .flowmessage-detail-head {
    border-color: #334155;
}

body.darkmode .flowmessage-thread-avatar,
body.darkmode .flowmessage-detail-avatar {
    background: #172554;
    color: #bfdbfe;
}

body.darkmode .flowmessage-search,
body.darkmode .flowmessage-search input,
body.darkmode .flowmessage-recipient-input,
body.darkmode .flowmessage-recipient-option,
body.darkmode .flowmessage-thread-name,
body.darkmode .flowmessage-thread-snippet,
body.darkmode .flowmessage-section-title span,
body.darkmode .flowmessage-detail-title,
body.darkmode .flowmessage-reply-head,
body.darkmode .flowmessage-bubble-body,
body.darkmode .flowmessage-context strong,
body.darkmode .flowmessage-thread-context strong {
    color: #f8fafc;
}

body.darkmode .flowmessage-thread-subject,
body.darkmode .flowmessage-detail-subject-label {
    color: #93c5fd;
}

body.darkmode .flowmessage-recipient-input {
    border-color: transparent;
    background: #0f172a;
}

body.darkmode .flowmessage-recipient-dropdown {
    border-color: #334155;
    background: #111827;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .36);
}

body.darkmode .flowmessage-recipient-option:hover,
body.darkmode .flowmessage-recipient-option:focus-visible,
body.darkmode .flowmessage-priority-toggle button:not(.is-active):hover,
body.darkmode .flowmessage-priority-toggle button:not(.is-active):focus-visible {
    background: #172554;
    color: #bfdbfe;
}

body.darkmode .flowmessage-recipient-chip {
    border-color: #1d4ed8;
    background: #172554;
    color: #dbeafe;
}

body.darkmode .flowmessage-recipient-person-code {
    border-color: rgba(96, 165, 250, .28);
    background: #2563eb;
    color: #ffffff;
}

body.darkmode .flowmessage-recipient-role-pill {
    border-color: rgba(52, 211, 153, .28);
    background: rgba(5, 150, 105, .18);
    color: #bbf7d0;
}

body.darkmode .flowmessage-recipient-role-pill.is-fuehrung {
    border-color: rgba(167, 139, 250, .34);
    background: rgba(124, 58, 237, .18);
    color: #ddd6fe;
}

body.darkmode .flowmessage-recipient-role-pill.is-assistenz {
    border-color: rgba(251, 191, 36, .34);
    background: rgba(217, 119, 6, .18);
    color: #fde68a;
}

body.darkmode .flowmessage-recipient-role-pill.is-admin {
    border-color: rgba(148, 163, 184, .30);
    background: rgba(51, 65, 85, .38);
    color: #cbd5e1;
}

body.darkmode .flowmessage-recipient-placeholder,
body.darkmode .flowmessage-recipient-option-main small,
body.darkmode .flowmessage-recipient-empty {
    color: #94a3b8;
}

body.darkmode .flowmessage-search input::placeholder {
    color: #8ca0bc;
    opacity: 1;
}

body.darkmode .flowmessage-thread:hover,
body.darkmode .flowmessage-thread:focus-within {
    border-color: #3b82f6;
    background: #172554;
}

body.darkmode .flowmessage-thread.is-active,
body.darkmode .flowmessage-bubble.is-own {
    border-color: #3b82f6;
    background: #172554;
}

body.darkmode .flowmessage-bubble.is-self-note {
    border-color: #3730a3;
    background: #1e1b4b;
}

body.darkmode .flowmessage-message-label,
body.darkmode .flowmessage-self-note-badge,
body.darkmode .flowmessage-self-note i {
    color: #c7d2fe;
}

body.darkmode .flowmessage-attachment {
    color: #bfdbfe;
}

body.darkmode .flowmessage-file-chip {
    color: #bfdbfe;
}

body.darkmode .flowmessage-file-control > span {
    color: #bfdbfe;
}

body.darkmode .self-notes-modal {
    border-color: #334155;
    background: #111827;
    color: #e5eefb;
}

body.darkmode .self-notes-modal .modal-header {
    border-color: #334155;
    background: #111827;
}

body.darkmode .self-notes-modal .modal-body {
    background: #0f172a;
}

body.darkmode .self-note-row {
    border-color: #334155;
    background: #111827;
    box-shadow: none;
}

body.darkmode .self-note-icon {
    background: #172554;
    color: #bfdbfe;
}

body.darkmode .self-note-title,
body.darkmode .self-note-empty strong {
    color: #f8fafc;
}

body.darkmode .self-note-body {
    color: #94a3b8;
}

body.darkmode .self-note-check span {
    border-color: #334155;
    background: #0f172a;
    color: #bfdbfe;
}

body.darkmode .self-note-check:hover span,
body.darkmode .self-note-check input:focus-visible + span {
    border-color: #60a5fa;
    background: #172554;
}

body.darkmode .self-note-check input:checked + span {
    border-color: #22c55e;
    background: rgba(22, 163, 74, .18);
    color: #bbf7d0;
}

body.darkmode .flowmessage-priority {
    color: #fbbf24;
}

body.darkmode .flowmessage-attachment:hover {
    border-color: #60a5fa;
    color: #dbeafe;
}

body.darkmode .flowmessage-draft-trash {
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(127, 29, 29, 0.22);
    color: #fecaca;
}

body.darkmode .flowmessage-thread-delete {
    color: #94a3b8;
}

body.darkmode .flowmessage-thread-delete:hover,
body.darkmode .flowmessage-thread-delete:focus-visible {
    border-color: #f87171;
    background: rgba(153, 27, 27, 0.34);
    color: #fecaca;
}

body.darkmode .flowmessage-draft-trash:hover,
body.darkmode .flowmessage-draft-trash:focus-visible {
    border-color: #f87171;
    background: rgba(153, 27, 27, 0.34);
}

body.darkmode .flowmessage-confirm-modal {
    border-color: #334155;
    background: #111827;
    color: #e5eefc;
}

body.darkmode .flowmessage-confirm-modal .modal-header,
body.darkmode .flowmessage-confirm-modal .modal-footer {
    border-color: #334155;
}

body.darkmode .flowmessage-confirm-modal .modal-title {
    color: #e5eefc;
}

body.darkmode .flowmessage .form-control,
body.darkmode .flowmessage .form-select,
body.darkmode .flowmessage textarea.form-control {
    border-color: #334155;
    background-color: #111827;
    color: #f8fafc;
}

body.darkmode .flowmessage .form-control::placeholder,
body.darkmode .flowmessage textarea.form-control::placeholder {
    color: #8ca0bc;
    opacity: 1;
}

@media (max-width: 900px) {
    .communication-page-head.workpaper-page-head {
        grid-template-columns: 1fr;
    }

    .communication-header-slot .workpaper-header-card.is-active {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .communication-header-slot .workpaper-title > div:last-child {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .flowmessage-head,
    .flowmessage-head-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .flowmessage-grid,
    .flowmessage-compose-grid {
        grid-template-columns: 1fr;
    }

    .flowmessage-recipient-picker {
        grid-template-columns: 1fr;
    }

    .flowmessage-field-head {
        align-items: flex-start;
        flex-direction: column;
    }
}



