/**
 * shadcn theme: page styles for "messages" (loaded after css/core/shadcn.php).
 * Scope every rule to this page's own wrapper so it cannot affect other pages.
 * Covers: messages page (inbox + conversation), chat dock and chat windows,
 * header Messages / Friend-request popovers.
 */

/* ================================================================== messages page: cards */
body.sc .ossn-messages .ossn-widget {
	border: 1px solid var(--sc-card-border) !important; border-radius: var(--sc-container-radius) !important; box-shadow: none !important;
	background: var(--card) !important; color: var(--card-foreground);
}
body.sc .ossn-messages .ossn-widget .widget-heading {
	border: 0 !important; border-bottom: 1px solid var(--border) !important; border-radius: 0 !important;
	font-size: 1rem !important; line-height: 1.5rem; font-weight: 500 !important; color: var(--card-foreground) !important;
	padding: var(--sc-card-pad) !important; background: transparent !important;
}
body.sc .ossn-messages .ossn-widget .widget-contents {
	border: 0 !important; border-radius: 0 0 var(--sc-container-radius) var(--sc-container-radius) !important; padding: var(--sc-card-pad) !important;
}

/* conversation header: avatar + status dot + name, delete as a ghost icon button */
body.sc .ossn-messages #message-with-user-widget .widget-heading {
	display: flex !important; align-items: center; gap: 0.5rem; position: relative; min-height: 0;
	padding-top: 0.75rem !important; padding-bottom: 0.75rem !important;
}
body.sc .ossn-messages #message-with-user-widget .widget-heading img {
	float: none !important; margin: 0 !important; width: 2rem !important; height: 2rem !important; border-radius: 999px !important; object-fit: cover; flex: 0 0 auto;
}
body.sc .ossn-messages #message-with-user-widget .widget-heading .ossn-inmessage-status-circle {
	position: absolute !important; margin: 0 !important; left: calc(var(--sc-card-pad) + 1.375rem); top: calc(0.75rem + 1.375rem);
	width: 0.625rem !important; height: 0.625rem !important; border: 2px solid var(--card) !important; box-sizing: content-box;
}
body.sc .ossn-messages .ossn-message-delete-conversation {
	float: none !important; margin-left: auto !important; display: inline-flex !important; align-items: center; justify-content: center;
	width: var(--sc-control-h); height: var(--sc-control-h); border-radius: var(--sc-control-radius); color: var(--muted-foreground) !important;
}
body.sc .ossn-messages .ossn-message-delete-conversation:hover { background: var(--accent); color: var(--accent-foreground) !important; }
body.sc .ossn-messages .ossn-message-delete-conversation i,
body.sc .ossn-messages .ossn-message-delete-conversation svg { width: 1rem !important; height: 1rem !important; margin: 0 !important; font-size: 1rem !important; }

/* ================================================================== inbox list (page + header popover) */
body.sc .ossn-messages .messages-from .user-item { padding: 0.75rem !important; gap: 0.75rem; align-items: flex-start; }
body.sc .ossn-messages .messages-from .msg-flex-c1 { position: relative; flex: 0 0 2rem; }
body.sc .ossn-messages .messages-from .user-item img { width: 2rem !important; height: 2rem !important; margin: 0 !important; border-radius: 999px !important; object-fit: cover; display: block; }
body.sc .ossn-messages .messages-from .ossn-inmessage-status-circle {
	margin: 0 !important; left: 1.375rem; top: 1.375rem; width: 0.625rem !important; height: 0.625rem !important;
	border: 2px solid var(--card) !important; box-sizing: content-box;
}
body.sc .ossn-messages .messages-from .user-item .data { margin: 0 !important; flex: 1 1 auto; min-width: 0; }

body.sc .ossn-messages .messages-from .user-item .name,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .name {
	font-size: 0.875rem !important; line-height: 1.25rem; font-weight: 500 !important; color: var(--foreground) !important; padding: 0 !important; margin: 0 !important;
}
body.sc .ossn-messages .messages-from .user-item .time,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .time {
	font-size: 0.75rem !important; line-height: 1.25rem; font-style: normal !important; color: var(--muted-foreground) !important; margin: 0 0 0 0.5rem !important;
}
body.sc .ossn-messages .messages-from .user-item .reply,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .reply {
	display: flex !important; align-items: center; gap: 0.25rem; clear: both; margin: 0.125rem 0 0 !important;
	font-size: 0.875rem !important; line-height: 1.25rem; color: var(--muted-foreground) !important;
}
body.sc .ossn-messages .messages-from .user-item .reply i,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .reply i { flex: 0 0 auto; margin: 0 !important; display: inline-flex; color: inherit !important; }
body.sc .ossn-messages .messages-from .user-item .reply-text,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .reply-text {
	display: block !important; flex: 1 1 auto; min-width: 0; margin: 0 !important; font-size: inherit !important; line-height: inherit; color: inherit !important;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ================================================================== conversation: bubbles */
body.sc .ossn-messages .message-inner .message-box-sent,
body.sc .ossn-messages .message-inner .message-box-recieved {
	box-shadow: none !important; padding: 0.5rem 0.75rem !important; margin: 0.25rem 0 !important;
	font-size: 0.875rem; line-height: 1.25rem;
}
body.sc .ossn-messages .message-inner .time-created {
	font-size: 0.75rem !important; line-height: 1.25rem; font-style: normal !important; opacity: 0.8;
}
body.sc .ossn-messages .message-inner .message-box-recieved .time-created { color: var(--muted-foreground) !important; opacity: 1; }
body.sc .ossn-messages .message-inner .ossn-message-delete { display: inline-flex; align-items: center; vertical-align: middle; cursor: pointer; }
body.sc .ossn-messages .message-inner .ossn-message-delete i,
body.sc .ossn-messages .message-inner .ossn-message-delete svg { width: 1rem !important; height: 1rem !important; margin: 0 !important; font-size: 1rem !important; }

/* ================================================================== conversation: composer */
body.sc .ossn-messages .message-form-form { margin: var(--sc-card-pad) 0 0 !important; padding: var(--sc-card-pad) 0 0 !important; }
body.sc .ossn-messages .message-form-form textarea {
	margin: 0 0 var(--sc-field-gap) !important; padding: 0.5rem var(--sc-control-px) !important;
	border: 1px solid var(--input) !important; border-radius: var(--sc-control-radius) !important;
	background: transparent !important; color: var(--foreground) !important; font-size: 0.875rem !important; line-height: 1.25rem;
}
body.sc .ossn-messages .message-form-form textarea::placeholder { color: var(--muted-foreground); }
body.sc .ossn-messages .message-form-form textarea:focus { outline: none; border-color: var(--ring) !important; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent) !important; }
body.sc .ossn-messages .message-form-form .controls { display: flex !important; align-items: center; gap: 0.25rem; }
body.sc .ossn-messages .message-form-form .controls input[type=submit] { order: 1; margin: 0 !important; }
body.sc .ossn-messages .message-form-form .controls .ossn-loading { order: 1; }
body.sc .ossn-messages .message-form-form .controls .ossn-message-pling { order: 2; }
body.sc .ossn-messages .message-form-form .controls .ossn-message-icon-attachment { order: 3; margin-left: auto !important; }
body.sc .ossn-messages .message-form-form .controls .ossn-message-attach-photo { order: 4; }
body.sc .ossn-messages .message-form-form .ossn-message-pling,
body.sc .ossn-messages .message-form-form .ossn-message-icon-attachment,
body.sc .ossn-messages .message-form-form .ossn-message-attach-photo {
	float: none !important; display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 auto;
	width: var(--sc-control-h) !important; height: var(--sc-control-h) !important; padding: 0 !important; margin: 0;
	border-radius: var(--sc-control-radius) !important; background: transparent !important; color: var(--muted-foreground) !important;
	cursor: pointer; font-size: 1rem !important; line-height: 1;
}
body.sc .ossn-messages .message-form-form .ossn-message-pling:hover,
body.sc .ossn-messages .message-form-form .ossn-message-icon-attachment:hover,
body.sc .ossn-messages .message-form-form .ossn-message-attach-photo:hover { background: var(--accent) !important; color: var(--accent-foreground) !important; }
body.sc .ossn-messages .message-form-form .ossn-message-pling i,
body.sc .ossn-messages .message-form-form .ossn-message-attach-photo i,
body.sc .ossn-messages .message-form-form .ossn-message-pling svg,
body.sc .ossn-messages .message-form-form .ossn-message-attach-photo svg {
	width: 1rem !important; height: 1rem !important; margin: 0 !important; padding: 0 !important; font-size: 1rem !important; color: inherit !important;
	display: inline-flex !important; align-items: center; justify-content: center;
}
body.sc .ossn-messages .message-form-form .ossn-message-icon-attachment::before { margin: 0 !important; color: inherit !important; font-size: 1rem !important; }

/* ================================================================== chat dock + chat windows */
body.sc .ossn-chat-base, body.sc .ossn-chat-base input, body.sc .ossn-chat-containers { font-family: inherit !important; }
body.sc .ossn-chat-base { font-size: 0.875rem; color: var(--foreground); }

/* chat dock height (2.5rem) and window offset: now in css/core/shadcn.php */

/* window */
body.sc .friend-tab-item .tab-container {
	border: 1px solid var(--sc-card-border) !important; border-radius: var(--radius) var(--radius) 0 0 !important; overflow: hidden;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
}
body.sc .friend-tab-item .tab-container .ossn-chat-tab-titles {
	display: flex; align-items: center; gap: 0.5rem; position: relative; height: 3rem; padding: 0 0.5rem 0 0.75rem !important;
	border: 0 !important; border-bottom: 1px solid var(--border) !important; /* card header: 1px line under it */
	border-radius: 0 !important; box-shadow: none !important;
}
body.sc .friend-tab-item .ossn-chat-tab-titles .ossn-chat-tab-user-icon { width: 2rem !important; height: 2rem !important; border-radius: 999px !important; object-fit: cover; flex: 0 0 auto; }
body.sc .friend-tab-item .ossn-chat-tab-titles .ossn-inchat-status-circle {
	position: absolute !important; margin: 0 !important; left: calc(0.75rem + 1.375rem); top: calc(50% + 0.375rem);
	width: 0.625rem !important; height: 0.625rem !important; border: 2px solid var(--card) !important; box-sizing: content-box;
}
body.sc .friend-tab-item .ossn-chat-tab-titles .text {
	flex: 1 1 auto; min-width: 0; margin: 0 !important; padding: 0 !important; font-size: 0.875rem !important; line-height: 1.25rem; font-weight: 500 !important;
}
body.sc .friend-tab-item .ossn-chat-tab-titles .text a { color: inherit !important; text-decoration: none; }
body.sc .friend-tab-item .ossn-chat-tab-titles .options { float: none !important; display: flex !important; align-items: center; gap: 0.125rem; flex: 0 0 auto; }
body.sc .friend-tab-item .ossn-chat-tab-titles .ossn-chat-option-title-icon {
	display: inline-flex !important; align-items: center; justify-content: center; width: 1.75rem !important; height: 1.75rem !important;
	padding: 0 !important; margin: 0 !important; border-radius: var(--sc-control-radius) !important; transform: none !important;
	font-size: 1rem !important; color: inherit !important;
}
/* title bar is a card header: muted icon buttons with the ghost accent hover */
body.sc .friend-tab-item .ossn-chat-tab-titles .ossn-chat-option-title-icon { color: var(--muted-foreground) !important; }
body.sc .friend-tab-item .ossn-chat-tab-titles .ossn-chat-option-title-icon:hover { background: var(--accent) !important; color: var(--accent-foreground) !important; }
body.sc .friend-tab-item .ossn-chat-tab-titles .ossn-chat-option-title-icon::before { margin: 0 !important; color: inherit !important; font-size: 1rem !important; }

/* messages area */
body.sc .friend-tab-item .tab-container .data { width: 100% !important; font-size: 0.875rem; padding: 0.5rem 0; }
body.sc .friend-tab-item .data .message-sender .text,
body.sc .friend-tab-item .data .message-reciever .text { box-shadow: none !important; font-size: 0.875rem !important; }
body.sc .friend-tab-item .data .message-sender .text .inner,
body.sc .friend-tab-item .data .message-reciever .text .inner { padding: 0.5rem 0.75rem !important; line-height: 1.25rem !important; }
body.sc .friend-tab-item .data .message-reciever .user-icon img { border-radius: 999px !important; width: 2rem; height: 2rem; object-fit: cover; }

/* composer row: input + smile + attachment as ghost icon buttons */
body.sc .friend-tab-item .friend-tab input[type='text'] {
	height: var(--sc-control-h) !important; padding: 0 var(--sc-control-px) !important; font-size: 0.875rem !important;
	margin: calc(-0.5 * var(--sc-control-h) - 3px) 0 0 !important; width: calc(var(--ossn-chat-panel-width, 330px) - 1.5rem - 4.125rem - 0.5rem) !important;
	border: 1px solid var(--input) !important; border-radius: var(--sc-control-radius) !important; background: transparent !important; color: var(--foreground) !important;
}
body.sc .friend-tab-item .friend-tab input[type='text']:focus { border-color: var(--ring) !important; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent) !important; }
body.sc .friend-tab-item .ossn-chat-icon-smile-set {
	display: flex !important; align-items: center; gap: 0.125rem; width: auto; height: auto; padding: 0 !important;
	margin: calc(-0.5 * var(--sc-control-h) - 3px) 0 0 calc(var(--ossn-chat-panel-width, 330px) - 1.5rem - 4.125rem) !important;
}
body.sc .friend-tab-item .ossn-chat-icon-smile,
body.sc .friend-tab-item .ossn-chat-icon-attachment {
	display: inline-flex !important; align-items: center; justify-content: center; width: var(--sc-control-h) !important; height: var(--sc-control-h) !important;
	border-radius: var(--sc-control-radius) !important; background: transparent !important; color: var(--muted-foreground) !important; font-size: 1rem !important;
}
body.sc .friend-tab-item .ossn-chat-icon-smile:hover,
body.sc .friend-tab-item .ossn-chat-icon-attachment:hover { background: var(--accent) !important; color: var(--accent-foreground) !important; }
body.sc .friend-tab-item .ossn-chat-icon-smile::before,
body.sc .friend-tab-item .ossn-chat-icon-attachment::before { margin: 0 !important; color: inherit !important; font-size: 1rem !important; }
body.sc .ossn-chat-icon-smilies {
	background: var(--popover) !important; color: var(--popover-foreground); border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
body.sc .ossn-chat-message-sending { background: var(--card) !important; }

/* dock friends list (below 1360px) */
body.sc .ossn-chat-base .ossn-chat-bar .friends-list {
	border: 1px solid var(--sc-card-border) !important; border-radius: var(--radius) var(--radius) 0 0 !important; overflow: hidden;
	box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
}
body.sc .ossn-chat-base .ossn-chat-bar .friends-list .ossn-chat-tab-titles { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; height: auto; padding: 0.75rem !important; }
body.sc .ossn-chat-base .ossn-chat-bar .friends-list .ossn-chat-tab-titles .text { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
body.sc .ossn-chat-base .ossn-chat-bar .friends-list-item:hover { background: var(--accent) !important; }
body.sc .ossn-chat-base .ossn-chat-bar .friends-list-item .friends-item-inner { display: flex; align-items: center; gap: 0.5rem; height: auto; margin: 0 !important; padding: 0.375rem 0.75rem !important; }
body.sc .ossn-chat-base .ossn-chat-bar .friends-list-item .icon { display: block; width: 1.5rem; height: 1.5rem; flex: 0 0 auto; }
body.sc .ossn-chat-base .ossn-chat-bar .friends-list-item .user-icon-small { width: 1.5rem !important; height: 1.5rem !important; border-radius: 999px !important; object-fit: cover; }
body.sc .ossn-chat-base .ossn-chat-bar .friends-list-item .name { margin: 0 !important; flex: 1 1 auto; min-width: 0; max-width: none; font-size: 0.875rem; line-height: 1.25rem; color: var(--foreground); }

/* ================================================================== header popovers: Messages + Friend requests */
/* popover heading height: now in css/core/shadcn.php */
body.sc .ossn-notifications-box .ossn-notification-messages .user-item { padding: 0 !important; border-bottom: 1px solid var(--border) !important; cursor: pointer; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item:last-child { border-bottom: 0 !important; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item-inner { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem 1rem !important; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .image { display: block !important; flex: 0 0 2rem; width: 2rem; height: 2rem; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .image img { width: 2rem !important; height: 2rem !important; object-fit: cover; display: block; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .data {
	float: none !important; flex: 1 1 auto; min-width: 0; width: auto !important; margin: 0 !important; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline;
}
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .name { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .time { grid-column: 2; float: none !important; white-space: nowrap; }
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .reply { grid-column: 1 / -1; }
body.sc .ossn-notifications-box:has(.selected.messages) .ossn-no-notification,
body.sc .ossn-notifications-box:has(.selected.firends) .ossn-no-notification {
	padding: 1.5rem 1rem !important; text-align: center; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground) !important;
}
body.sc .ossn-notifications-box .ossn-notification-messages,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item { width: 100% !important; margin: 0 !important; float: none !important; }
body.sc .ossn-messages .messages-from .user-item .reply i,
body.sc .ossn-messages .messages-from .user-item .reply svg,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .reply i,
body.sc .ossn-notifications-box .ossn-notification-messages .user-item .reply svg { width: 1rem !important; height: 1rem !important; font-size: 1rem !important; }
/* OSSN forces a permanent scrollbar on the list; only scroll when it overflows */
body.sc .ossn-notifications-box .messages-inner { overflow-y: auto !important; }
/* popover footer height: now in css/core/shadcn.php */

/* ================================================================== messages page: one panel (inbox + conversation)
   Owner decision messages-1: inbox and conversation sit in one bordered panel with a 1px divider,
   like the kit Messaging template. Stacked below 992px with a horizontal divider.
   Markup: theme views messages/pages/{view,all,messages-none}.php add .sc-msg-panel. */
body.sc .ossn-messages .sc-msg-panel {
	border: 1px solid var(--sc-card-border); border-radius: var(--sc-container-radius); overflow: hidden;
	background: var(--card); color: var(--card-foreground); box-shadow: none;
}
body.sc .ossn-messages .sc-msg-panel > [class*="col-"] { display: flex; flex-direction: column; min-width: 0; }
/* the two cards inside lose their own frame: the panel is the frame */
body.sc .ossn-messages .sc-msg-panel .ossn-widget {
	border: 0 !important; border-radius: 0 !important; margin: 0 !important; flex: 1 1 auto; background: transparent !important;
}
body.sc .ossn-messages .sc-msg-panel .ossn-widget .widget-contents { border-radius: 0 !important; }
/* both headers the same height so the bottom borders line up across the divider */
body.sc .ossn-messages .sc-msg-panel .ossn-widget .widget-heading {
	display: flex !important; align-items: center; box-sizing: border-box; min-height: 3.5625rem;
	padding-top: 0.75rem !important; padding-bottom: 0.75rem !important;
}
@media (min-width: 992px) {
	body.sc .ossn-messages .sc-msg-panel > .col-lg-4 { border-right: 1px solid var(--border); }
}
@media (max-width: 991.98px) {
	body.sc .ossn-messages .sc-msg-panel > .col-lg-4 { border-bottom: 1px solid var(--border); }
}

/* ================================================================== messages page: kit Empty state
   Owner decisions messages-2 (no conversation open) and messages-3 (empty inbox).
   Centred: muted 40px icon box, 16px medium title, 14px muted line. Icon is 20px (core .sc-empty rule). */
body.sc .ossn-messages .sc-msg-empty {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
	flex: 1 1 auto; padding: 3rem 1.5rem; text-align: center; font-size: 0.875rem; color: var(--card-foreground);
}
body.sc .ossn-messages .sc-msg-empty-media {
	display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin-bottom: 0.5rem;
	border-radius: var(--radius); background: var(--muted); color: var(--foreground);
}
body.sc .ossn-messages .sc-msg-empty-media i { display: inline-flex; margin: 0; }
body.sc .ossn-messages .sc-msg-empty-title { font-size: 1rem; line-height: 1.5rem; font-weight: 500; color: var(--foreground); }
body.sc .ossn-messages .sc-msg-empty-desc { max-width: 20rem; font-size: 0.875rem; line-height: 1.25rem; color: var(--muted-foreground); }
/* empty state icon is 20px; the core "i[data-icon] .sc-icon" 16px rule is more specific than core ".sc-empty .sc-icon" */
body.sc .ossn-messages .sc-msg-empty-media i[data-icon] .sc-icon { width: var(--sc-icon-lg) !important; height: var(--sc-icon-lg) !important; }
/* empty inbox "New message" button (owner decision inbox-button): a little space under the text,
   and its icon back to 16px (the core .sc-empty rule makes every icon inside an Empty state 20px) */
body.sc .ossn-messages .sc-msg-empty .sc-msg-empty-action { margin-top: 0.5rem; text-decoration: none; }
body.sc .ossn-messages .sc-msg-empty .sc-msg-empty-action .sc-icon,
body.sc .ossn-messages .sc-msg-empty .sc-msg-empty-action i[data-icon] .sc-icon { width: var(--sc-icon) !important; height: var(--sc-icon) !important; }
 