/* Passionfarm front-end app styles: auth screen + Telegram-like chat. */

:root {
	--pf-bg: #14120a;
	--pf-panel: #1b1810;
	--pf-panel-2: #262216;
	--pf-accent: #f5c518;
	--pf-accent-2: #d9a400;
	--pf-accent-grad: linear-gradient( 135deg, #ffd83a 0%, #d9a400 100% );
	--pf-text: #cfc9b8;
	--pf-muted: #9a9077;
	--pf-mine: #4d4011;
	--pf-bubble: #221e13;
	--pf-danger: #e3504f;
	--pf-border: #332e1d;
	--pf-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--pf-font-display: "Sora", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
	box-sizing: border-box;
}

body.pf-app {
	margin: 0;
	background:
		radial-gradient( 1200px 600px at 80% -10%, rgba( 245, 197, 24, 0.10 ), transparent 60% ),
		radial-gradient( 900px 500px at -10% 110%, rgba( 245, 197, 24, 0.08 ), transparent 55% ),
		var(--pf-bg);
	color: var(--pf-text);
	font-family: var(--pf-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	letter-spacing: 0.1px;
}

/* ---------- Auth screen ---------- */

.pf-auth {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.pf-auth__card {
	width: 100%;
	max-width: 400px;
	background: linear-gradient( 180deg, rgba( 245, 197, 24, 0.06 ), transparent 40% ), var(--pf-panel);
	border: 1px solid var(--pf-border);
	border-radius: 20px;
	padding: 34px 32px;
	box-shadow: 0 24px 70px rgba( 0, 0, 0, 0.55 );
}

.pf-auth__logo {
	text-align: center;
	margin-bottom: 8px;
}

.pf-auth__logo img {
	max-height: 64px;
	width: auto;
}

.pf-auth__title {
	text-align: center;
	font-family: var(--pf-font-display);
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.3px;
	margin: 8px 0 4px;
}

.pf-auth__subtitle {
	text-align: center;
	color: var(--pf-muted);
	margin: 0 0 24px;
	font-size: 14px;
}

.pf-tabs {
	display: flex;
	margin-bottom: 20px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--pf-panel-2);
}

.pf-tabs__btn {
	flex: 1;
	padding: 10px;
	text-align: center;
	cursor: pointer;
	color: var(--pf-muted);
	font-size: 14px;
	border: none;
	background: transparent;
}

.pf-tabs__btn.is-active {
	background: var(--pf-accent-grad);
	color: #241c00;
	font-weight: 600;
}

.pf-field {
	margin-bottom: 14px;
}

.pf-field label {
	display: block;
	font-size: 13px;
	color: var(--pf-muted);
	margin-bottom: 6px;
}

.pf-field input {
	width: 100%;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--pf-border);
	background: var(--pf-panel-2);
	color: var(--pf-text);
	font-size: 15px;
	font-family: inherit;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.pf-field input:focus {
	outline: none;
	border-color: var(--pf-accent);
	box-shadow: 0 0 0 3px rgba( 245, 197, 24, 0.18 );
}

.pf-field__hint {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	color: var(--pf-muted);
}

.pf-btn {
	display: block;
	width: 100%;
	padding: 13px;
	border-radius: 12px;
	border: none;
	background: var(--pf-accent-grad);
	color: #241c00;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 8px 22px rgba( 217, 164, 0, 0.32 );
	transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.pf-btn:hover {
	filter: brightness( 1.05 );
	transform: translateY( -1px );
	box-shadow: 0 10px 26px rgba( 217, 164, 0, 0.42 );
}

.pf-btn:active {
	transform: translateY( 0 );
}

.pf-divider {
	display: flex;
	align-items: center;
	text-align: center;
	color: var(--pf-muted);
	font-size: 12px;
	margin: 18px 0;
}

.pf-divider::before,
.pf-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--pf-border);
}

.pf-divider span {
	padding: 0 12px;
}

.pf-google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 12px;
	border-radius: 12px;
	background: #fff;
	color: #3c4043;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid #dadce0;
	transition: background 0.18s ease, transform 0.12s ease;
}

.pf-google:hover {
	background: #f7f8f8;
}

.pf-google img {
	width: 18px;
	height: 18px;
}

.pf-notice {
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 13px;
	margin-bottom: 16px;
}

.pf-notice--error {
	background: rgba( 227, 80, 79, 0.15 );
	color: #ff9a99;
}

.pf-pane {
	display: none;
}

.pf-pane.is-active {
	display: block;
}

/* ---------- Chat (Telegram-like) ---------- */

#pf-chat-root {
	height: 100vh;
}

.pf-chat {
	display: flex;
	height: 100vh;
}

.pf-chat__sidebar {
	width: 300px;
	background: var(--pf-panel);
	border-right: 1px solid var(--pf-border);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
}

.pf-chat__brand {
	padding: 18px 20px;
	font-family: var(--pf-font-display);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.3px;
	border-bottom: 1px solid var(--pf-border);
}

.pf-chat__channel {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 14px;
	margin: 2px 8px;
	border-radius: 12px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.pf-chat__channel:hover {
	background: rgba( 255, 255, 255, 0.04 );
}

.pf-chat__channel--active,
.pf-chat__channel--active:hover {
	background: rgba( 245, 197, 24, 0.16 );
}

.pf-chat__channel-avatar {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	background: var(--pf-accent-grad);
	color: #241c00;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 19px;
	font-weight: 700;
	flex-shrink: 0;
}

.pf-chat__channel-avatar--img {
	background: none;
	overflow: hidden;
}

.pf-chat__channel-avatar--img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pf-chat__header-channel-avatar {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	overflow: hidden;
	margin-right: 12px;
}

.pf-chat__header-channel-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pf-chat__channel-meta {
	flex: 1;
	min-width: 0;
}

.pf-chat__channel-name {
	font-weight: 600;
}

.pf-chat__channel-sub {
	font-size: 12px;
	color: var(--pf-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pf-chat__channel-sub--unread {
	color: var(--pf-accent);
	font-weight: 600;
}

.pf-chat__channel-badge {
	flex-shrink: 0;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--pf-accent-grad);
	color: #241c00;
	font-size: 12px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}

/* Unread messages divider (Telegram / WhatsApp style). */
.pf-unread-divider {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 8px 0;
	position: relative;
}

.pf-unread-divider::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: rgba( 255, 255, 255, 0.08 );
}

.pf-unread-divider__label {
	position: relative;
	background: rgba( 245, 197, 24, 0.18 );
	color: var(--pf-accent);
	border-radius: 12px;
	padding: 3px 14px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pf-chat__main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background:
 	radial-gradient( 600px 400px at 70% 0%, rgba( 245, 197, 24, 0.06 ), transparent 60% ),
		var(--pf-bg);
}

.pf-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: rgba( 18, 27, 22, 0.85 );
	backdrop-filter: blur( 10px );
	border-bottom: 1px solid var(--pf-border);
}

.pf-chat__header-info {
	flex: 1;
	min-width: 0;
}

.pf-chat__title {
	font-family: var(--pf-font-display);
	font-weight: 600;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Mobile back arrow (hidden on desktop). */
.pf-chat__back {
	display: none;
	flex-shrink: 0;
	margin-right: 6px;
	padding: 4px 10px 4px 0;
	border: none;
	background: transparent;
	color: var(--pf-accent);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.pf-chat__me {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
}

.pf-chat__me-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
}

.pf-chat__logout {
	color: var(--pf-accent);
	text-decoration: none;
	font-size: 13px;
}

.pf-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px 18%;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pf-chat__empty {
	text-align: center;
	color: var(--pf-muted);
	margin: auto;
}

.pf-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 75%;
}

.pf-msg--mine {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.pf-msg__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	flex-shrink: 0;
}

.pf-msg__bubble {
	background: var(--pf-bubble);
	border: 1px solid rgba( 255, 255, 255, 0.04 );
	padding: 9px 13px;
	border-radius: 16px;
	border-bottom-left-radius: 5px;
	position: relative;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.25 );
}

.pf-msg--mine .pf-msg__bubble {
	background: var(--pf-mine);
	border-color: rgba( 245, 197, 24, 0.25 );
	border-bottom-left-radius: 16px;
	border-bottom-right-radius: 5px;
}

.pf-msg__author {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--pf-accent);
	margin-bottom: 2px;
}

.pf-msg__text {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	word-wrap: break-word;
}

.pf-msg__text p {
	margin: 0;
}

.pf-msg__text a {
	color: var(--pf-accent);
	text-decoration: underline;
}

.pf-msg__text a:hover {
	color: var(--pf-accent);
	text-decoration: underline;
}

.pf-msg__time {
	display: block;
	text-align: right;
	font-size: 11px;
	color: var(--pf-muted);
	margin-top: 2px;
}

.pf-chat__error {
	color: #ff9a99;
	text-align: center;
	padding: 6px;
	font-size: 13px;
}

.pf-chat__composer {
	display: flex;
	gap: 10px;
	padding: 14px 18%;
	background: rgba( 18, 27, 22, 0.85 );
	backdrop-filter: blur( 10px );
	border-top: 1px solid var(--pf-border);
}

.pf-chat__input {
	flex: 1;
	padding: 12px 16px;
	border-radius: 22px;
	border: 1px solid transparent;
	background: var(--pf-panel-2);
	color: var(--pf-text);
	font-size: 15px;
	font-family: inherit;
	transition: border-color 0.18s ease;
}

.pf-chat__input:focus {
	outline: none;
	border-color: var(--pf-accent);
}

.pf-chat__send {
	padding: 0 24px;
	border-radius: 22px;
	border: none;
	background: var(--pf-accent-grad);
	color: #241c00;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.18s ease;
}

.pf-chat__send:hover:not(:disabled) {
	filter: brightness( 1.06 );
}

.pf-chat__send:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ---------- Channels sidebar ---------- */

.pf-chat__channels {
	flex: 1;
	overflow-y: auto;
}

.pf-chat__empty-channels {
	padding: 18px 20px;
	color: var(--pf-muted);
	font-size: 13px;
}

.pf-chat__channel-meta {
	min-width: 0;
}

.pf-chat__channel:hover {
	background: rgba( 255, 255, 255, 0.04 );
}

.pf-chat__channel--active,
.pf-chat__channel--active:hover {
	background: rgba( 245, 197, 24, 0.16 );
}

.pf-chat__channel-name {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* "Me" / profile button at the bottom of the sidebar. */
.pf-chat__me {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-top: 1px solid var(--pf-border);
	cursor: pointer;
}

.pf-chat__me:hover {
	background: var(--pf-panel-2);
}

.pf-chat__me-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

.pf-chat__me-name {
	flex: 1;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pf-chat__me-edit {
	color: var(--pf-muted);
}

.pf-chat__subtitle {
	font-size: 12px;
	color: var(--pf-muted);
}

/* ---------- Message extras: name, media, reactions ---------- */

.pf-msg__name {
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 4px;
}

.pf-msg__media {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 6px;
}

.pf-media-item {
	max-width: 320px;
	max-height: 360px;
	width: 100%;
	border-radius: 10px;
	display: block;
}

.pf-reactions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
}

.pf-react {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	border: 1px solid var(--pf-border);
	background: var(--pf-panel-2);
	color: var(--pf-text);
	border-radius: 14px;
	padding: 1px 8px;
	font-size: 13px;
	cursor: pointer;
	line-height: 1.6;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.pf-react:hover:not(:disabled) {
	background: rgba( 255, 255, 255, 0.06 );
}

.pf-react:disabled {
	cursor: default;
	opacity: 0.8;
}

/* WhatsApp-style: no full background, just a subtle accent outline/text. */
.pf-react--mine {
	background: transparent;
	border-color: var(--pf-accent);
	color: var(--pf-accent);
	font-weight: 600;
}

.pf-react--add {
	border: none;
	background: transparent;
	color: var(--pf-muted);
	padding: 2px 6px;
	font-size: 15px;
}

.pf-react--add:hover:not(:disabled) {
	background: transparent;
	color: var(--pf-accent);
}

.pf-react-add {
	position: relative;
}

.pf-react-picker {
	position: absolute;
	bottom: 130%;
	left: 0;
	display: flex;
	gap: 4px;
	background: var(--pf-panel);
	border: 1px solid var(--pf-border);
	border-radius: 20px;
	padding: 6px 8px;
	box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.5 );
	z-index: 5;
}

.pf-react-picker button {
	border: none;
	background: transparent;
	font-size: 20px;
	cursor: pointer;
	line-height: 1;
}

.pf-react-picker button:hover {
	transform: scale( 1.25 );
}

/* ---------- Composer ---------- */

.pf-composer {
	padding: 12px 18%;
	background: var(--pf-panel);
	border-top: 1px solid #0b1218;
}

.pf-composer__previews {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.pf-preview {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--pf-panel-2);
}

.pf-preview img,
.pf-preview video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pf-preview__x {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	border: none;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	cursor: pointer;
	line-height: 1;
}

.pf-composer__name {
	width: 100%;
	padding: 8px 14px;
	margin-bottom: 8px;
	border-radius: 12px;
	border: none;
	background: var(--pf-panel-2);
	color: var(--pf-text);
	font-size: 14px;
}

.pf-composer__name:focus,
.pf-composer__input:focus {
	outline: none;
}

.pf-composer__row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
}

.pf-attach {
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--pf-panel-2);
	font-size: 20px;
	cursor: pointer;
}

.pf-composer__input {
	flex: 1;
	resize: none;
	max-height: 140px;
	padding: 12px 16px;
	border-radius: 18px;
	border: none;
	background: var(--pf-panel-2);
	color: var(--pf-text);
	font-size: 15px;
	font-family: inherit;
	line-height: 1.4;
}

.pf-composer__send {
	flex-shrink: 0;
	height: 44px;
	padding: 0 24px;
	border-radius: 22px;
	border: none;
	background: var(--pf-accent-grad);
	color: #241c00;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.18s ease;
}

.pf-composer__send:hover:not(:disabled) {
	filter: brightness( 1.06 );
}

.pf-composer__send:disabled {
	opacity: 0.6;
	cursor: default;
}

.pf-chat__readonly {
	padding: 16px 18%;
	text-align: center;
	color: var(--pf-muted);
	background: var(--pf-panel);
	border-top: 1px solid var(--pf-border);
	font-size: 14px;
}

/* ---------- Profile modal ---------- */

.pf-modal {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0.6 );
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 50;
	padding: 20px;
}

.pf-modal__card {
	width: 100%;
	max-width: 420px;
	background: var(--pf-panel);
	border: 1px solid var(--pf-border);
	border-radius: 18px;
	padding: 28px;
	box-shadow: 0 24px 70px rgba( 0, 0, 0, 0.6 );
}

.pf-modal__title {
	margin: 0 0 18px;
	font-family: var(--pf-font-display);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.3px;
}

.pf-modal__loading {
	text-align: center;
	font-size: 28px;
	color: var(--pf-muted);
}

.pf-modal__avatar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
}

.pf-modal__avatar-pic {
	position: relative;
	display: inline-block;
	cursor: pointer;
}

.pf-modal__avatar img,
.pf-modal__avatar-pic img {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	border: 2px solid var(--pf-border);
	transition: filter 0.18s ease;
}

.pf-modal__avatar-pic:hover img {
	filter: brightness( 0.7 );
}

.pf-modal__avatar-cam {
	position: absolute;
	right: -2px;
	bottom: -2px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--pf-accent-grad);
	color: #241c00;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	border: 3px solid var(--pf-panel);
	box-shadow: 0 4px 10px rgba( 0, 0, 0, 0.35 );
}

.pf-modal__photo-btn {
	color: var(--pf-accent);
	cursor: pointer;
	font-size: 14px;
}

.pf-chat__header-avatar {
	flex-shrink: 0;
	padding: 0;
	margin-left: 6px;
	border: none;
	background: none;
	cursor: pointer;
	border-radius: 50%;
	line-height: 0;
}

.pf-chat__header-avatar img {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid transparent;
	transition: border-color 0.18s ease;
}

.pf-chat__header-avatar:hover img {
	border-color: var(--pf-accent);
}

.pf-field textarea {
	width: 100%;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--pf-border);
	background: var(--pf-panel-2);
	color: var(--pf-text);
	font-size: 15px;
	font-family: inherit;
	resize: vertical;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.pf-field textarea:focus {
	outline: none;
	border-color: var(--pf-accent);
	box-shadow: 0 0 0 3px rgba( 245, 197, 24, 0.18 );
}

.pf-modal__actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

.pf-btn--ghost {
	background: var(--pf-panel-2);
}

.pf-btn--ghost:hover {
	background: #25333f;
}

/* ---------- Media gallery (Telegram-like grid) ---------- */

.pf-gallery {
	display: grid;
	gap: 3px;
	margin: 4px 0 6px;
	border-radius: 12px;
	overflow: hidden;
	max-width: 420px;
}

.pf-gallery--1 {
	grid-template-columns: 1fr;
}

.pf-gallery--2 {
	grid-template-columns: 1fr 1fr;
}

.pf-gallery--3 {
	grid-template-columns: 1fr 1fr;
}

.pf-gallery--3 .pf-gallery__item:first-child {
	grid-column: 1 / -1;
}

.pf-gallery--4 {
	grid-template-columns: 1fr 1fr;
}

.pf-gallery__item {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	cursor: zoom-in;
	background: #0b1218;
}

.pf-gallery--1 .pf-gallery__item {
	aspect-ratio: 16 / 10;
}

.pf-gallery__media {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.pf-gallery__item:hover .pf-gallery__media {
	transform: scale( 1.05 );
}

.pf-gallery__video {
	display: block;
	width: 100%;
	height: 100%;
}

.pf-gallery__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 34px;
	color: #fff;
	background: rgba( 0, 0, 0, 0.25 );
	text-shadow: 0 2px 6px rgba( 0, 0, 0, 0.6 );
	pointer-events: none;
}

/* ---------- Message moderation tools ---------- */

.pf-msg__bubble {
	position: relative;
}

.pf-msg__tools {
	position: absolute;
	top: -10px;
	right: 8px;
	display: none;
	gap: 4px;
	background: var(--pf-panel);
	border: 1px solid var(--pf-border);
	border-radius: 18px;
	padding: 3px 6px;
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.4 );
	z-index: 3;
}

.pf-msg--mine .pf-msg__tools {
	right: auto;
	left: 8px;
}

.pf-msg:hover .pf-msg__tools {
	display: flex;
}

.pf-msg__tool {
	border: none;
	background: transparent;
	color: var(--pf-text);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 50%;
}

.pf-msg__tool:hover {
	background: var(--pf-panel-2);
}

.pf-msg__tool--danger:hover {
	background: rgba( 227, 80, 79, 0.2 );
	color: var(--pf-danger);
}

.pf-msg__edited {
	font-style: italic;
	color: var(--pf-muted);
}

/* ---------- Activity / history log ---------- */

.pf-log {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	max-height: 50vh;
	overflow-y: auto;
}

.pf-log__item {
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--pf-panel-2);
	margin-bottom: 8px;
	font-size: 14px;
	border-left: 3px solid var(--pf-accent);
}

.pf-log__item--deleted {
	border-left-color: var(--pf-danger);
}

.pf-log__item--edited {
	border-left-color: #e0a93f;
}

.pf-log__who {
	font-weight: 600;
}

.pf-log__when {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--pf-muted);
}

@media ( max-width: 768px ) {
	/* Single-pane navigation: show either the channel list or the chat. */
	.pf-chat__sidebar,
	.pf-chat__main {
		width: 100%;
		flex: 1 0 100%;
		min-width: 0;
	}

	.pf-chat--mobile-list .pf-chat__main {
		display: none;
	}

	.pf-chat--mobile-chat .pf-chat__sidebar {
		display: none;
	}

	.pf-chat__back {
		display: inline-flex;
		align-items: center;
	}

	.pf-chat__messages,
	.pf-composer,
	.pf-chat__readonly {
		padding-left: 12px;
		padding-right: 12px;
	}

	.pf-chat__messages {
		padding-top: 14px;
		padding-bottom: 14px;
	}

	.pf-chat__header {
		padding: 12px 14px;
	}

	.pf-chat__channel {
		padding: 14px 16px;
	}

	.pf-msg {
		max-width: 88%;
	}

	/* Touch devices have no hover, so always expose moderation tools. */
	.pf-msg__tools {
		display: flex;
	}

	.pf-auth {
		padding: 16px;
	}

	.pf-auth__card {
		padding: 24px 20px;
	}

	/* The info drawer becomes a full-screen overlay on small screens. */
	.pf-info {
		position: fixed;
		inset: 0;
		width: 100%;
		z-index: 60;
		border-left: none;
	}

	.pf-chat__search {
		padding-left: 14px;
		padding-right: 14px;
	}
}

/* ---------- WYSIWYG rich text editor ---------- */

.pf-rte {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--pf-panel-2);
	border-radius: 18px;
	overflow: hidden;
}

.pf-rte__toolbar {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 4px 8px;
	border-bottom: 1px solid var(--pf-border);
	flex-wrap: wrap;
}

.pf-rte__btn {
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	border: none;
	background: transparent;
	color: var(--pf-muted);
	font-size: 14px;
	border-radius: 7px;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease, color 0.15s ease;
}

.pf-rte__btn:hover {
	background: rgba( 255, 255, 255, 0.08 );
	color: var(--pf-text);
}

.pf-rte__sep {
	width: 1px;
	height: 18px;
	margin: 0 4px;
	background: var(--pf-border);
}

.pf-rte__area {
	min-height: 24px;
	max-height: 160px;
	overflow-y: auto;
	padding: 10px 16px;
	color: var(--pf-text);
	font-size: 15px;
	font-family: inherit;
	line-height: 1.4;
	outline: none;
}

.pf-rte__area:empty::before {
	content: attr( data-placeholder );
	color: var(--pf-muted);
	pointer-events: none;
}

.pf-rte__area p {
	margin: 0 0 4px;
}

.pf-rte__area a {
	color: var(--pf-accent);
}

/* In the edit modal the editor sits on a card; give it a border. */
.pf-field .pf-rte {
	border: 1px solid var(--pf-border);
}

/* ---------- File attachments (docs) ---------- */

.pf-files {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 4px 0 6px;
}

.pf-file {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 12px;
	background: rgba( 255, 255, 255, 0.05 );
	text-decoration: none;
	color: var(--pf-text);
	max-width: 320px;
	transition: background 0.15s ease;
}

.pf-file:hover {
	background: rgba( 255, 255, 255, 0.09 );
}

.pf-file__icon {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	background: rgba( 245, 197, 24, 0.15 );
}

.pf-file__meta {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.pf-file__name {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pf-file__size {
	font-size: 12px;
	color: var(--pf-muted);
}

/* File chips in the composer / edit previews. */
.pf-preview--file {
	width: auto;
	min-width: 120px;
	max-width: 180px;
	height: auto;
	padding: 8px 10px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.pf-preview__file {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.pf-preview__file-icon {
	font-size: 20px;
}

.pf-preview__file-name {
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Header actions: search + info (3-dot) ---------- */

.pf-chat__header-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.pf-chat__icon-btn {
	width: 38px;
	height: 38px;
	border: none;
	background: transparent;
	color: var(--pf-text);
	font-size: 18px;
	border-radius: 50%;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease;
}

.pf-chat__icon-btn:hover,
.pf-chat__icon-btn--active {
	background: rgba( 245, 197, 24, 0.16 );
	color: var(--pf-accent);
}

/* ---------- In-conversation search bar ---------- */

.pf-chat__search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 20px;
	background: rgba( 18, 27, 22, 0.85 );
	backdrop-filter: blur( 10px );
	border-bottom: 1px solid var(--pf-border);
}

.pf-chat__search-icon {
	font-size: 14px;
	opacity: 0.7;
}

.pf-chat__search-input {
	flex: 1;
	padding: 9px 14px;
	border-radius: 18px;
	border: 1px solid var(--pf-border);
	background: var(--pf-panel-2);
	color: var(--pf-text);
	font-size: 14px;
	font-family: inherit;
}

.pf-chat__search-input:focus {
	outline: none;
	border-color: var(--pf-accent);
}

.pf-chat__search-clear {
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: var(--pf-panel-2);
	color: var(--pf-muted);
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}

.pf-chat__search-clear:hover {
	color: var(--pf-text);
}

/* ---------- Profile row with logout (sidebar) ---------- */

.pf-chat__me {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pf-chat__me-info {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	border-radius: 10px;
	padding: 2px 6px;
	margin: -2px -6px;
}

.pf-chat__me-info:hover {
	background: rgba( 255, 255, 255, 0.04 );
}

.pf-chat__me-logout {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: 10px;
	color: var(--pf-muted);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease;
}

.pf-chat__me-logout:hover {
	background: rgba( 227, 80, 79, 0.16 );
	color: var(--pf-danger);
}

.pf-chat__me-logout-icon {
	font-size: 16px;
	line-height: 1;
}

/* ---------- Channel info drawer (Media / Docs / Links) ---------- */

.pf-info {
	width: 340px;
	flex-shrink: 0;
	background: var(--pf-panel);
	border-left: 1px solid var(--pf-border);
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.pf-info__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--pf-border);
}

.pf-info__title {
	font-family: var(--pf-font-display);
	font-weight: 600;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pf-info__close {
	border: none;
	background: transparent;
	color: var(--pf-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.pf-info__close:hover {
	color: var(--pf-text);
}

.pf-info__tabs {
	display: flex;
	padding: 0 12px;
	gap: 4px;
	border-bottom: 1px solid var(--pf-border);
}

.pf-info__tab {
	flex: 1;
	padding: 12px 6px;
	border: none;
	background: transparent;
	color: var(--pf-muted);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.pf-info__tab--active {
	color: var(--pf-accent);
	border-bottom-color: var(--pf-accent);
}

.pf-info__count {
	display: inline-block;
	margin-left: 5px;
	font-size: 11px;
	color: var(--pf-muted);
}

.pf-info__tab--active .pf-info__count {
	color: var(--pf-accent);
}

.pf-info__body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
}

.pf-info__empty {
	text-align: center;
	color: var(--pf-muted);
	font-size: 14px;
	padding: 30px 10px;
}

.pf-info__media {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 4px;
}

.pf-info__media-item {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 8px;
	cursor: zoom-in;
	background: #0b1218;
}

.pf-info__media-item img,
.pf-info__media-item .pf-gallery__media {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.pf-info__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pf-info__list .pf-file {
	max-width: none;
}

.pf-info__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 12px;
	background: rgba( 255, 255, 255, 0.05 );
	text-decoration: none;
	color: var(--pf-text);
	transition: background 0.15s ease;
}

.pf-info__link:hover {
	background: rgba( 255, 255, 255, 0.09 );
}

.pf-info__link-icon {
	flex-shrink: 0;
	font-size: 16px;
}

.pf-info__link-meta {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.pf-info__link-label {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pf-info__link-url {
	font-size: 12px;
	color: var(--pf-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Use full dynamic viewport height where supported (mobile browser chrome). */
@supports ( height: 100dvh ) {
	#pf-chat-root,
	.pf-chat {
		height: 100dvh;
	}
}
