/* Shoutbox Legacy — every colour derives from the active WoltLab style. */

.shoutbox {
	--sb-gap: 12px;
	--sb-radius: 14px;
	--sb-surface: color-mix(in srgb, var(--wcfContentText, #808080) 7%, transparent);
	--sb-surface-strong: color-mix(in srgb, var(--wcfContentText, #808080) 12%, transparent);
	--sb-accent: var(--wcfButtonPrimaryBackground, #3b82f6);
	--sb-accent-text: var(--wcfButtonPrimaryText, #fff);
	--sb-line: color-mix(in srgb, var(--wcfContentText, #808080) 15%, transparent);
	--sb-muted: var(--wcfContentDimmedText, #8b8b8b);

	/* Eine eigene Schrift hier setzen, damit Emojis auf allen Geraeten gleich
	   aussehen, z. B.:  --sb-emoji-font: "Twemoji Mozilla";  */
	--sb-emoji-font: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;

	display: flex;
	flex-direction: column;
	gap: var(--sb-gap);
	color: var(--wcfContentText, inherit);
	container-type: inline-size;
}

/* ---------------------------------------------------------------- header */

.shoutbox__header {
	align-items: center;
	display: flex;
	gap: 8px;
	justify-content: space-between;
	min-height: 30px;
}

.shoutbox__headerTitle {
	display: flex;
	flex-direction: column;
	font-weight: 600;
	letter-spacing: -.01em;
	line-height: 1.25;
	min-width: 0;
}

.shoutbox__headerDescription {
	color: var(--sb-muted);
	font-size: 78%;
	font-weight: 400;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shoutbox__headerActions {
	display: flex;
	gap: 2px;
}

.shoutbox__headerButton {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--sb-muted);
	cursor: pointer;
	display: inline-flex;
	height: 30px;
	justify-content: center;
	padding: 0;
	transition: background-color .15s ease, color .15s ease;
	width: 30px;
}

.shoutbox__headerButton:hover {
	background-color: var(--sb-surface-strong);
	color: var(--wcfContentText, inherit);
}

.shoutbox__headerButton.active {
	background-color: color-mix(in srgb, var(--sb-accent) 18%, transparent);
	color: var(--sb-accent);
}

/* ----------------------------------------------------------------- body */

.shoutbox__body {
	display: flex;
	gap: var(--sb-gap);
	min-height: 0;
}

.shoutbox__entries {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	list-style: none;
	margin: 0;
	max-height: 360px;
	min-height: 140px;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2px 4px 2px 2px;
	scroll-behavior: smooth;
	scrollbar-color: var(--sb-line) transparent;
	scrollbar-width: thin;
}

.shoutbox__entries::-webkit-scrollbar {
	width: 8px;
}

.shoutbox__entries::-webkit-scrollbar-thumb {
	background-color: var(--sb-line);
	border-radius: 99px;
}

.shoutbox__empty {
	color: var(--sb-muted);
	font-size: var(--wcfFontSizeSmall, .85rem);
	margin: auto;
	padding: 24px 12px;
	text-align: center;
}

/* --------------------------------------------------------- chat layout */

.shoutbox--modern .shoutbox__entry {
	align-items: flex-start;
	display: flex;
	gap: 8px;
}

.shoutbox--modern .shoutbox__entry--own {
	flex-direction: row-reverse;
}

.shoutbox--modern .shoutbox__avatar img {
	border-radius: 50%;
	display: block;
	height: 32px;
	object-fit: cover;
	width: 32px;
}

.shoutbox--modern .shoutbox__content {
	background-color: var(--sb-surface);
	border-radius: var(--sb-radius);
	border-start-start-radius: 4px;
	max-width: 82%;
	min-width: 0;
	padding: 7px 12px 9px;
}

.shoutbox--modern .shoutbox__entry--own .shoutbox__content {
	background-color: color-mix(in srgb, var(--sb-accent) 20%, transparent);
	border-start-end-radius: 4px;
	border-start-start-radius: var(--sb-radius);
}

.shoutbox--modern .shoutbox__entry--whisper .shoutbox__content {
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sb-accent) 45%, transparent);
}

.shoutbox__meta {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wcfFontSizeSmall, .85rem);
	gap: 6px;
	line-height: 1.3;
	margin-bottom: 1px;
}

.shoutbox__username {
	font-weight: 600;
}

.shoutbox__username:hover {
	text-decoration: none;
}

.shoutbox__time,
.shoutbox__edited {
	color: var(--sb-muted);
	font-size: 82%;
}

.shoutbox__badge {
	background-color: color-mix(in srgb, var(--sb-accent) 25%, transparent);
	border-radius: 99px;
	font-size: 74%;
	font-weight: 500;
	letter-spacing: .02em;
	padding: 1px 8px;
	text-transform: lowercase;
}

.shoutbox__message {
	font-variant-emoji: unicode;
	line-height: 1.45;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.shoutbox__message img.smiley {
	height: 1.3em;
	vertical-align: text-bottom;
	width: auto;
}

.shoutbox__image {
	border-radius: 8px;
	display: block;
	margin-top: 6px;
	max-height: 220px;
	max-width: 100%;
}

.shoutbox__code {
	background-color: var(--sb-surface-strong);
	border-radius: 5px;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 88%;
	padding: 1px 6px;
}

.shoutbox__spoiler {
	background-color: currentColor;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color .15s ease;
}

.shoutbox__spoiler:hover {
	background-color: transparent;
}

.shoutbox__mention {
	font-weight: 600;
}

/* entry actions */

.shoutbox__entryActions {
	align-self: center;
	display: flex;
	gap: 1px;
	opacity: 0;
	transition: opacity .15s ease;
}

.shoutbox__entry:hover .shoutbox__entryActions,
.shoutbox__entry:focus-within .shoutbox__entryActions {
	opacity: 1;
}

.shoutbox__entryAction {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 7px;
	color: var(--sb-muted);
	cursor: pointer;
	display: inline-flex;
	font-size: 78%;
	height: 26px;
	justify-content: center;
	padding: 0;
	width: 26px;
}

.shoutbox__entryAction--disabled,
.shoutbox__entryAction--disabled:hover {
	background: transparent;
	cursor: not-allowed;
	opacity: .35;
}

.shoutbox__entryAction:hover {
	background-color: var(--sb-surface-strong);
	color: var(--wcfContentText, inherit);
}

/* ------------------------------------------------------ classic layout */

.shoutbox--classic .shoutbox__entries {
	gap: 0;
}

.shoutbox--classic .shoutbox__entry {
	align-items: center;
	border-radius: 6px;
	display: flex;
	gap: 8px;
	padding: 4px 6px;
	transition: background-color .12s ease;
}

.shoutbox--classic .shoutbox__entry:hover {
	background-color: var(--sb-surface);
}

.shoutbox--classic .shoutbox__avatar img {
	border-radius: 50%;
	display: block;
	height: 22px;
	width: 22px;
}

.shoutbox--classic .shoutbox__content {
	align-items: baseline;
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

.shoutbox--classic .shoutbox__meta {
	margin-bottom: 0;
}

.shoutbox--classic .shoutbox__entry--whisper {
	background-color: color-mix(in srgb, var(--sb-accent) 12%, transparent);
}

/* ----------------------------------------------------------- online list */

.shoutbox__online {
	border-inline-start: 1px solid var(--sb-line);
	flex: 0 0 168px;
	font-size: var(--wcfFontSizeSmall, .85rem);
	max-height: 360px;
	overflow-y: auto;
	padding-inline-start: var(--sb-gap);
	scrollbar-width: thin;
}

.shoutbox__onlineHeader {
	align-items: center;
	color: var(--sb-muted);
	display: flex;
	gap: 6px;
	margin-bottom: 8px;
}

.shoutbox__onlineList {
	display: flex;
	flex-direction: column;
	gap: 2px;
	list-style: none;
	margin: 0;
}

.shoutbox__onlineUser a {
	align-items: center;
	border-radius: 8px;
	display: flex;
	gap: 8px;
	min-width: 0;
	padding: 3px 6px;
	transition: background-color .12s ease;
}

.shoutbox__onlineUser a:hover {
	background-color: var(--sb-surface);
	text-decoration: none;
}

.shoutbox__onlineUser img {
	border-radius: 50%;
	height: 22px;
	width: 22px;
}

.shoutbox__onlineUser span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shoutbox__onlineEmpty {
	color: var(--sb-muted);
}

/* ------------------------------------------------------------ input area */

.shoutbox__error {
	background-color: color-mix(in srgb, #dc2626 16%, transparent);
	border-radius: 8px;
	font-size: var(--wcfFontSizeSmall, .85rem);
	padding: 7px 12px;
}

.shoutbox__notice {
	background-color: var(--sb-surface);
	border-radius: 10px;
	color: var(--sb-muted);
	font-size: var(--wcfFontSizeSmall, .85rem);
	padding: 10px;
	text-align: center;
}

.shoutbox__form {
	border-top: 1px solid var(--sb-line);
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: var(--sb-gap);
}

.shoutbox__whisperBar {
	align-items: center;
	background-color: color-mix(in srgb, var(--sb-accent) 18%, transparent);
	border-radius: 8px;
	display: flex;
	font-size: var(--wcfFontSizeSmall, .85rem);
	gap: 8px;
	justify-content: space-between;
	padding: 5px 6px 5px 12px;
}

.shoutbox__whisperCancel {
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: inherit;
	cursor: pointer;
	padding: 2px 6px;
}

.shoutbox__toolbar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1px;
}

.shoutbox__tool {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: var(--sb-muted);
	cursor: pointer;
	display: inline-flex;
	height: 30px;
	justify-content: center;
	padding: 0;
	transition: background-color .15s ease, color .15s ease;
	width: 30px;
}

.shoutbox__tool:hover {
	background-color: var(--sb-surface-strong);
	color: var(--wcfContentText, inherit);
}

.shoutbox__tool.active {
	background-color: color-mix(in srgb, var(--sb-accent) 18%, transparent);
	color: var(--sb-accent);
}

.shoutbox__counter {
	color: var(--sb-muted);
	font-size: 76%;
	font-variant-numeric: tabular-nums;
	margin-inline-start: auto;
	padding-inline-end: 4px;
}

.shoutbox__counter--warning {
	color: #dc2626;
	font-weight: 600;
}

/* colour palette */

.shoutbox__colors {
	background-color: var(--sb-surface);
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 10px 12px;
}

.shoutbox__colorGrid {
	display: grid;
	gap: 6px;
	grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
}

.shoutbox__color {
	aspect-ratio: 1;
	border: 2px solid transparent;
	border-radius: 8px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
	cursor: pointer;
	padding: 0;
	transition: transform .1s ease, border-color .1s ease;
}

.shoutbox__color:hover {
	border-color: var(--wcfContentText, #fff);
	transform: scale(1.12);
}

.shoutbox__colorCustom {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wcfFontSizeSmall, .85rem);
	gap: 8px;
}

.shoutbox__colorInput {
	background: transparent;
	block-size: 32px;
	border: 1px solid var(--wcfInputBorder, rgba(127, 127, 127, .4));
	border-radius: 8px;
	cursor: pointer;
	inline-size: 48px;
	padding: 2px;
}

/* emoji picker */

.shoutbox__emojis {
	background-color: var(--sb-surface);
	border-radius: 12px;
	padding: 8px;
}

.shoutbox__emojiTabs {
	border-bottom: 1px solid var(--sb-line);
	display: flex;
	gap: 2px;
	margin-bottom: 6px;
	overflow-x: auto;
	padding-bottom: 6px;
	scrollbar-width: thin;
}

.shoutbox__emojiTab {
	background: transparent;
	font-family: var(--sb-emoji-font);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	flex: 0 0 auto;
	font-size: 18px;
	line-height: 1;
	opacity: .55;
	padding: 5px 8px;
	transition: background-color .12s ease, opacity .12s ease;
}

.shoutbox__emojiTab:hover {
	opacity: 1;
}

.shoutbox__emojiTab.active {
	background-color: color-mix(in srgb, var(--sb-accent) 20%, transparent);
	opacity: 1;
}

.shoutbox__emojiGrid {
	display: grid;
	gap: 1px;
	grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	max-height: 190px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.shoutbox__emoji {
	align-items: center;
	aspect-ratio: 1;
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	font-family: var(--sb-emoji-font);
	font-size: 21px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	transition: background-color .1s ease, transform .1s ease;
}

.shoutbox__emoji:hover {
	background-color: var(--sb-surface-strong);
	transform: scale(1.18);
}

/* live hint */

.shoutbox {
	position: relative;
}

.shoutbox__toast {
	background-color: var(--sb-accent);
	border: 0;
	border-radius: 999px;
	bottom: 84px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
	color: var(--sb-accent-text);
	cursor: pointer;
	font: inherit;
	font-size: var(--wcfFontSizeSmall, .85rem);
	font-weight: 600;
	inset-inline-start: 50%;
	padding: 8px 16px;
	position: absolute;
	transform: translateX(-50%);
	white-space: nowrap;
	z-index: 40;
}

.shoutbox__toast:hover {
	filter: brightness(1.08);
}

/* muting */

.shoutbox__badge--muted {
	background-color: color-mix(in srgb, #dc2626 28%, transparent);
}

.shoutbox__notice--muted {
	align-items: center;
	background-color: color-mix(in srgb, #dc2626 14%, transparent);
	color: var(--wcfContentText, inherit);
	display: flex;
	gap: 10px;
	text-align: start;
}

.shoutbox__muteDialog {
	background-color: var(--wcfContentBackground, transparent);
	border: 1px solid var(--sb-line);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
}

.shoutbox__muteDialogTitle {
	font-size: var(--wcfFontSizeSmall, .85rem);
}

.shoutbox__muteRow {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.shoutbox__muteDuration,
.shoutbox__muteReason {
	background-color: var(--wcfInputBackground, transparent);
	border: 1px solid var(--wcfInputBorder, rgba(127, 127, 127, .4));
	border-radius: 8px;
	color: var(--wcfInputText, inherit);
	font: inherit;
	padding: 6px 8px;
}

.shoutbox__muteReason {
	flex: 1 1 160px;
	min-width: 0;
}

.shoutbox__muteCustom {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wcfFontSizeSmall, .85rem);
	gap: 6px;
}

.shoutbox__muteCustomValue {
	background-color: var(--wcfInputBackground, transparent);
	border: 1px solid var(--wcfInputBorder, rgba(127, 127, 127, .4));
	border-radius: 8px;
	color: var(--wcfInputText, inherit);
	font: inherit;
	padding: 6px 8px;
	width: 90px;
}

.shoutbox__muteCustomUnit {
	background-color: var(--wcfInputBackground, transparent);
	border: 1px solid var(--wcfInputBorder, rgba(127, 127, 127, .4));
	border-radius: 8px;
	color: var(--wcfInputText, inherit);
	font: inherit;
	padding: 6px 8px;
}

.shoutbox__muteScope {
	align-items: center;
	display: flex;
	font-size: var(--wcfFontSizeSmall, .85rem);
	gap: 6px;
}

.shoutbox__muteActions {
	display: flex;
	gap: 6px;
}

/* composer */

.shoutbox__input {
	position: relative;
}

.shoutbox__composer {
	align-items: center;
	background-color: var(--wcfInputBackground, transparent);
	border: 1px solid var(--wcfInputBorder, rgba(127, 127, 127, .4));
	border-radius: 12px;
	display: flex;
	gap: 6px;
	padding: 4px 5px 4px 12px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.shoutbox__composer:focus-within {
	border-color: var(--sb-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sb-accent) 18%, transparent);
}

.shoutbox__textarea {
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--wcfInputText, inherit);
	flex: 1 1 auto;
	font: inherit;
	line-height: 1.45;
	margin: 0;
	max-height: 150px;
	min-height: 24px;
	min-width: 0;
	outline: none;
	overflow-y: auto;
	padding: 6px 0;
	resize: none;
	scrollbar-width: thin;
}

.shoutbox__textarea::placeholder {
	color: var(--sb-muted);
	opacity: 1;
}

.shoutbox__textarea:focus {
	border: 0;
	box-shadow: none;
	outline: none;
}

.shoutbox__send {
	align-items: center;
	align-self: flex-end;
	background-color: var(--sb-accent);
	border: 0;
	border-radius: 10px;
	color: var(--sb-accent-text);
	cursor: pointer;
	display: flex;
	flex: 0 0 auto;
	height: 34px;
	justify-content: center;
	padding: 0;
	transition: filter .15s ease, transform .12s ease;
	width: 38px;
}

.shoutbox__send:hover {
	filter: brightness(1.1);
}

.shoutbox__send:active {
	transform: scale(.94);
}

/* mention auto completion */

.shoutbox__mentions {
	background-color: var(--wcfContentBackground, #fff);
	border: 1px solid var(--sb-line);
	border-radius: 10px;
	bottom: calc(100% + 6px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	inset-inline-start: 0;
	list-style: none;
	margin: 0;
	max-height: 190px;
	overflow-y: auto;
	padding: 4px;
	position: absolute;
	width: min(280px, 100%);
	z-index: 30;
}

.shoutbox__mentionItem {
	border-radius: 7px;
	cursor: pointer;
	padding: 6px 10px;
}

.shoutbox__mentionItem.active,
.shoutbox__mentionItem:hover {
	background-color: var(--sb-surface-strong);
}

/* inline editing */

.shoutbox__editInput {
	background-color: var(--wcfInputBackground, transparent);
	border: 1px solid var(--wcfInputBorder, rgba(127, 127, 127, .4));
	border-radius: 8px;
	color: var(--wcfInputText, inherit);
	font: inherit;
	padding: 6px 10px;
	width: 100%;
}

.shoutbox__editActions {
	display: flex;
	gap: 6px;
	margin-top: 6px;
}

.shoutbox__editButton {
	background-color: var(--sb-accent);
	border: 0;
	border-radius: 7px;
	color: var(--sb-accent-text);
	cursor: pointer;
	font-size: 84%;
	padding: 4px 12px;
}

.shoutbox__editButton--cancel {
	background-color: var(--sb-surface-strong);
	color: var(--wcfContentText, inherit);
}

/* ------------------------------------------------------------- variants */

.shoutbox--sidebar .shoutbox__body {
	flex-direction: column;
}

.shoutbox--sidebar .shoutbox__entries {
	max-height: 280px;
}

.shoutbox--sidebar .shoutbox__content {
	max-width: 100%;
}

.shoutbox--sidebar .shoutbox__online {
	border-inline-start: 0;
	border-top: 1px solid var(--sb-line);
	flex: 0 0 auto;
	max-height: 130px;
	padding-inline-start: 0;
	padding-top: 8px;
}

.shoutbox--sidebar .shoutbox__entryActions {
	opacity: 1;
}

/* -------------------------------------------------------------- archive */

.shoutboxArchive {
	display: flex;
	flex-direction: column;
	gap: 14px;
	list-style: none;
	margin: 0;
}

.shoutboxArchive__entry {
	display: grid;
	gap: 12px;
	grid-template-columns: auto 1fr;
}

.shoutboxArchive__avatar img {
	border-radius: 50%;
	height: 32px;
	width: 32px;
}

.shoutboxArchive__meta {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	font-size: var(--wcfFontSizeSmall, .85rem);
	gap: 8px;
}

.shoutboxArchive__ip {
	color: var(--sb-muted);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 80%;
	opacity: .8;
}

.shoutboxArchive__time {
	color: var(--sb-muted);
}

/* ---------------------------------------------------------- narrow view */

@container (max-width: 520px) {
	.shoutbox__body {
		flex-direction: column;
	}

	.shoutbox__online {
		border-inline-start: 0;
		border-top: 1px solid var(--sb-line);
		flex: 0 0 auto;
		max-height: 120px;
		padding-inline-start: 0;
		padding-top: 8px;
	}

	.shoutbox__entryActions {
		opacity: 1;
	}

	.shoutbox--modern .shoutbox__content {
		max-width: 88%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shoutbox *,
	.shoutbox *::before,
	.shoutbox *::after {
		animation-duration: .01ms !important;
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
	}
}
