/* .common-frame and main.content set font-size: 0 - every page sets its own */
.common-frame.chat-moderation { font-size: 14px; }
.chat-moderation h1 { margin: 0 0 16px; font-size: 32px; font-weight: 400; }
.chat-moderation .none { display: none !important; }

/* the filter row as on /employees/: 200px fields from the left, buttons on the right */
.chat-moderation-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.chat-moderation-filter .classowl-input-frame { width: 200px; }
.chat-moderation-filter .ctrls { margin-left: auto; display: flex; gap: 10px; }
.chat-moderation-filter .ctrls .classowl-button { width: auto; }
/* the chosen reason reads in full ("Reason: Harassment or bullying", longer in German); its tooltip has it too */
.chat-moderation-filter .classowl-input-frame.reason { width: 280px; }
/* × in the search box, left of the magnifier, while there is something to clear */
.chat-moderation-filter .classowl-input-frame.search { position: relative; width: 260px; }
.chat-moderation-filter .classowl-input-frame.icon-right.icon-wide.search.has-value > .input { padding-right: 60px; }
.chat-moderation-filter .search-clear { position: absolute; top: 50%; right: 34px; transform: translateY(-50%); width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--chat-text-muted); cursor: pointer; }
.chat-moderation-filter .search-clear:hover { background: #eef1f6; color: var(--chat-text); }
/* Clear filters: a quiet text button after the fields */
.chat-moderation-clear { padding: 4px 2px; border: 0; background: none; color: var(--chat-accent); font: inherit; cursor: pointer; }
.chat-moderation-clear:hover { text-decoration: underline; }

/* Keyboard focus shows on everything a moderator can reach with Tab: links, the pager, buttons
   and the sortable headers (the app's own styles take the outline away; fields have their own
   focus border) */
.chat-moderation a:focus-visible,
.chat-moderation button:focus-visible,
.chat-moderation [data-sort]:focus-visible { outline: 2px solid var(--chat-accent); outline-offset: 2px; border-radius: 2px; }
.chat-moderation [data-sort] { cursor: pointer; }

/* tables are the app's .classowl-table-large; only the clickable rows are ours */
.chat-moderation-table tr[data-link], .chat-moderation-table tr[data-block] { cursor: pointer; }
.chat-moderation-table tr[data-link]:hover td, .chat-moderation-table tr[data-block]:hover td { background: #f7f9fb; }
.chat-moderation-table td.go { width: 24px; text-align: right; }

/* live filter: the results wait dimmed and out of reach until the answer replaces them */
.chat-moderation-results { transition: opacity .15s; }
.chat-moderation-results.is-loading { opacity: .5; pointer-events: none; }

.chat-moderation-person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-moderation-person .photo { width: 28px; height: 28px; border-radius: 50%; background-size: cover; background-position: center; flex: none; }
.chat-moderation-person .email { display: block; color: var(--chat-text-muted); font-size: 12px; }

/* Status chips: the app's hues, darkened until the text clears 4.5:1 on its soft background */
.chat-moderation-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.chat-moderation-status.status-new { color: var(--chat-accent); background: #edf2fb; }
.chat-moderation-status.status-in_review { color: #c2410c; background: #fff4e5; }
.chat-moderation-status.status-resolved { color: #0b7a45; background: #e7f7ef; }
.chat-moderation-status.status-dismissed { color: var(--chat-text-muted); background: #f0f3f8; }
.chat-moderation .report-type { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; font-size: 11px; background: #eef2f6; color: var(--chat-text-muted); white-space: nowrap; }

.chat-moderation-empty { padding: 32px; text-align: center; color: var(--chat-text-muted); background: #fff; }

.chat-moderation-pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.chat-moderation-pagination .pages { display: flex; gap: 4px; }
.chat-moderation-pagination .page { min-width: 28px; height: 28px; line-height: 28px; text-align: center; border: 1px solid #e3e6ea; border-radius: 4px; }
.chat-moderation-pagination .page.current { background: var(--chat-accent); color: #fff; border-color: var(--chat-accent); }
.chat-moderation-pagination .page.disabled { pointer-events: none; opacity: .4; }

@media (max-width: 768px) {
    .common-frame.chat-moderation { padding: 16px; }
    .chat-moderation-filter .classowl-input-frame, .chat-moderation-filter .classowl-input-frame.reason, .chat-moderation-filter .classowl-input-frame.search { width: 100%; }
    .chat-moderation-filter .ctrls { margin-left: 0; }
    /* Status is the column a moderator scans for: the reporter gives way, names wrap */
    .chat-moderation-reports .reporter { display: none; }
    .chat-moderation-reports .chat-moderation-person .nowrap { white-space: normal; overflow-wrap: anywhere; }
    /* Blocked Users: the person, the date, Unblock and the arrow stay on screen; the rest is in the details */
    .chat-moderation-blocks .role, .chat-moderation-blocks .blockedby, .chat-moderation-blocks .reason, .chat-moderation-blocks .report { display: none; }
    .chat-moderation-blocks .chat-moderation-person .nowrap { white-space: normal; overflow-wrap: anywhere; }
    .chat-moderation-blocks td.date { white-space: normal; }
}

.chat-moderation-report .back { display: inline-block; margin-bottom: 16px; }
/* "Report RPT-1123", its status chip as in the list, and what was reported */
.chat-moderation-report .report-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.chat-moderation-report .report-head h1 { margin: 0; }
/* the size of the status chip next to it */
.chat-moderation-report .report-head .report-type { margin-left: 0; padding: 2px 10px; border-radius: 12px; font-size: 12px; color: var(--chat-text-muted); }
.chat-moderation-report .panels { display: grid; grid-template-columns: 300px 1fr 300px; gap: 16px; align-items: start; }
.chat-moderation-report .panel { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 16px; }
.chat-moderation-report .panel h2 { font-size: 15px; margin: 0 0 12px; }
/* each label above its value: the column is narrow, and side by side a name or a date wrapped */
.chat-moderation-report dl { margin: 0 0 16px; }
.chat-moderation-report dt { color: var(--chat-text-muted); font-size: 12px; }
.chat-moderation-report dd { margin: 2px 0 10px; min-width: 0; overflow-wrap: anywhere; }
/* A 1000-character comment scrolls in its own box instead of pushing Status and Block User far down */
.chat-moderation-report dd.details { max-height: 8em; overflow-y: auto; white-space: pre-wrap; }
.chat-moderation-report .info form, .chat-moderation-report .info > .classowl-button { display: block; margin-bottom: 8px; }
.chat-moderation-report .info .classowl-button { width: 100%; box-sizing: border-box; text-align: center; }
.chat-moderation-report .note { margin-top: 12px; padding: 8px 10px; background: #fff7d6; border: 1px solid #f0d878; border-radius: 4px; font-size: 12px; }
.chat-moderation-blocked { display: block; margin-bottom: 8px; color: var(--chat-danger-text); }

.chat-moderation-message { padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; background: #f5f7f9; }
.chat-moderation-message .meta { font-size: 12px; color: var(--chat-text-muted); margin-bottom: 2px; }
.chat-moderation-message .sender { font-weight: 600; color: var(--chat-text); }
.chat-moderation-message .text { max-height: 16em; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-moderation-message .attachments { margin-top: 4px; font-size: 13px; }
.chat-moderation-message .attachments-title { font-size: 12px; color: var(--chat-text-muted); }
.chat-moderation-message .attachments ul { margin: 2px 0 0; padding: 0; list-style: none; }
.chat-moderation-message .attachments a { overflow-wrap: anywhere; }
/* Files as the chat bubble draws them (chats.css .chat-attachment-*): image thumbnails and videos in a row, other files as chips */
.chat-moderation-message .attachments ul { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-moderation-message .attachments li.image img { display: block; height: 120px; max-width: 200px; border-radius: 6px; object-fit: cover; }
.chat-moderation-message .attachments li.video video { display: block; width: 240px; max-width: 100%; border-radius: 6px; background: #000; }
.chat-moderation-message .attachments li.file { flex-basis: 100%; }
.chat-moderation-message .attachments li.file a, .chat-moderation-message .attachments li.file.unavailable { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px; border-radius: 6px; background: rgba(0, 0, 0, .06); text-decoration: none; }
.chat-moderation-message .attachments li.file .size { flex-shrink: 0; font-size: 12px; color: var(--chat-text-muted); }
.chat-moderation-message .attachments li.file.unavailable { font-style: italic; color: var(--chat-text-muted); }
.chat-moderation-message.reported { background: #fdecea; border: 1px solid #f5b7b1; }
.chat-moderation-message .mark { color: var(--chat-danger-text); font-weight: 600; }
.chat-moderation-message .edited { font-style: italic; }
.chat-moderation-message .edited.after-report { color: var(--chat-danger-text); font-weight: 600; }
.chat-moderation-message .history { margin: 6px 0 0 12px; padding-left: 10px; border-left: 2px solid #d8dee4; font-size: 12px; color: var(--chat-text-muted); }
.chat-moderation-message .history + .history { margin-top: 4px; }
.chat-moderation-message .history-title { font-weight: 600; }
.chat-moderation-message .history.after-report .history-title { color: var(--chat-danger-text); }
.chat-moderation-message .history ul { margin: 2px 0 0; padding: 0; list-style: none; }
.chat-moderation-message .history li { margin: 1px 0; }
.chat-moderation-message .history-text { color: var(--chat-text); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-moderation-message.tombstone .text { font-style: italic; color: var(--chat-text-muted); }
/* Delete message (OWL-893): a quiet link at the right of each live message, the app's data-confirm asks first */
.chat-moderation-message form.delete { float: right; margin: 0; }
.chat-moderation-message form.delete button { border: 0; padding: 0; background: none; font-size: 12px; color: var(--chat-danger-text); cursor: pointer; }
.chat-moderation-message form.delete button:hover { text-decoration: underline; }
.chat-moderation-report .context-note { font-size: 12px; color: var(--chat-text-muted); margin-bottom: 8px; }
.chat-moderation-report .notes textarea { width: 100%; resize: vertical; }
.chat-moderation-saved { color: #0b7a45; }
/* "120 / 5000" under a box with a limit, red when the box is full */
.chat-moderation-count { display: block; margin: -4px 0 8px; text-align: right; font-size: 12px; color: var(--chat-text-muted); }
.chat-moderation-count.is-full { color: var(--chat-danger-text); }
/* Save Notes on the left, "Saved" at the right under the box's corner - on one line, so the
   word coming and going never moves the button */
.chat-moderation-report .notes .notes-ctrls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-moderation-warning { margin: 12px 0; padding: 8px 10px; background: #eef4fd; border-radius: 4px; font-size: 12px; }

@media (max-width: 1100px) { .chat-moderation-report .panels { grid-template-columns: 1fr; } }
/* the info column is narrow: a moderator needs the whole name, so it wraps instead of trailing off */
.chat-moderation-report .info .chat-moderation-person .nowrap { white-space: normal; overflow-wrap: anywhere; }


/* room between a field and its button, and between the status group and the actions */
.chat-moderation-report .info form.status label { display: block; margin-bottom: 4px; }
.chat-moderation-report .info form.status .classowl-input-frame { margin-bottom: 8px; }
.chat-moderation-report .info form.status { margin-bottom: 16px; }
.chat-moderation-report .notes .classowl-input-frame { margin-bottom: 8px; }

/* Blocked Users: heading with Block User, row actions, dialogs */
/* × of the moderation dialogs is a button (Tab reaches it): the app's look, none of a button's own */
.modal-chat-block .container > .form-close { padding: 0; border: 0; background: none; font-family: inherit; }
.modal-chat-block .container > .form-close:focus-visible { opacity: 1; outline: 2px solid var(--chat-accent); outline-offset: 2px; }
/* the row's arrow, as on Reports: it opens the block details */
.chat-moderation-go { padding: 4px 6px; border: 0; background: none; color: var(--chat-accent); font-size: 16px; cursor: pointer; }
/* the Block User picker's line: what to type, nobody found, more than listed - red when the search failed */
.chat-moderation-picker-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chat-moderation-picker-hint { font-size: 12px; color: var(--chat-text-muted); text-align: right; }
.chat-moderation-picker-hint.is-error { color: var(--chat-danger-text); }
.chat-moderation-table td.actions .classowl-button.more { height: 34px; line-height: 32px; }
.chat-moderation-card { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; padding: 12px; background: #f5f7f9; border-radius: 6px; }
.chat-moderation-card .photo { width: 44px; height: 44px; border-radius: 50%; background-size: cover; background-position: center; flex: none; }
.chat-moderation-card .name { font-weight: 600; }
.chat-moderation-card .email, .chat-moderation-card .role { font-size: 13px; color: var(--chat-text-muted); }
.chat-moderation-details { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0 0 20px; font-size: 14px; }
.chat-moderation-details dt { color: var(--chat-text-muted); }
.chat-moderation-details dd { margin: 0; overflow-wrap: anywhere; }
.chat-moderation-details dd.comment { white-space: pre-wrap; }
.chat-moderation-details a.disabled { pointer-events: none; color: inherit; }
.chat-moderation-status.status-blocked { color: var(--chat-danger-text); }

/* the right column: Admin Notes */
.chat-moderation-report .side { display: flex; flex-direction: column; gap: 16px; }

/* The shared table's headers are #b2b2b2, 2.1:1 on the table's background: the secondary grey here (6:1) */
.chat-moderation .classowl-table-large > table > thead > tr > th { color: var(--chat-text-muted); }
/* The app's modal writes its labels in #657fac (4.1:1) and its x at 40% of it (1.6:1): the secondary grey, whole */
.chat-moderation .modal-chat-block label { color: var(--chat-text-muted); }
.chat-moderation .modal-chat-block .container > .form-close { color: var(--chat-text-muted); opacity: 1; }
