/**
 * TWO Platform
 * Module: Communication
 * File: communication.css
 * Version: 1.0.1
 *
 * Responsibility:
 * Presentation styles for the Communication inbox, conversations,
 * message bubbles, reply composer, and unified message composer.
 */

/* =========================================
   TWO PLATFORM — INBOX
========================================= */

.two-inbox {
	max-width: 860px;
	margin: 0 auto;
	padding: 10px 0 48px;
}

.two-inbox-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 26px;
}

.two-inbox-heading-group {
	min-width: 0;
}

.two-inbox-heading-group h2 {
	margin: 0 0 7px;
	font-size: 38px;
	line-height: 1.15;
	font-weight: 800;
	color: #111;
}

.two-inbox-heading-group p {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	color: #666;
}

.two-inbox-new-message,
.two-inbox-new-message:visited {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 8px 14px;
	border: 1px solid #ff7220;
	border-radius: 999px;
	background: #ff7220;
	color: #fff !important;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none !important;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.two-inbox-new-message:hover,
.two-inbox-new-message:focus {
	background: #dd5d14;
	border-color: #dd5d14;
	color: #fff !important;
	text-decoration: none !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
	outline: none;
}

.two-inbox-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.two-inbox-list a.two-inbox-item,
.two-inbox-list a.two-inbox-item:visited {
	position: relative;
	display: block;
	padding: 16px 18px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px;
	background: #fff;
	color: inherit !important;
	text-decoration: none !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.two-inbox-item::before {
	content: "";
	position: absolute;
	top: 14px;
	bottom: 14px;
	left: 0;
	width: 4px;
	border-radius: 0 999px 999px 0;
	background: transparent;
}

.two-inbox-item.is-unread {
	background: #fffaf6;
	border-color: rgba(255, 114, 32, 0.22);
}

.two-inbox-item.is-unread::before {
	background: #ff7220;
}

.two-inbox-list a.two-inbox-item:hover,
.two-inbox-list a.two-inbox-item:focus {
	color: inherit !important;
	text-decoration: none !important;
	transform: translateY(-2px);
	border-color: rgba(0, 0, 0, 0.12);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
	outline: none;
}

.two-inbox-list a.two-inbox-item:focus-visible {
	border-color: #ff7220;
	box-shadow: 0 0 0 3px rgba(255, 114, 32, 0.16), 0 10px 24px rgba(0, 0, 0, 0.10);
}

.two-inbox-item-main {
	min-width: 0;
}

.two-inbox-item-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	gap: 18px;
}

.two-inbox-identity {
	min-width: 0;
}

.two-inbox .two-member-identity-inbox {
	margin: 0;
}

.two-inbox .two-member-identity-avatar {
	width: 50px;
	height: 50px;
	flex-basis: 50px;
}

.two-inbox .two-member-identity-name {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.25;
}

.two-inbox .two-member-identity-badge,
.two-inbox .two-member-identity-status {
	font-size: 11px;
	font-weight: 800;
}

.two-inbox-fallback-title {
	display: block;
	font-size: 16px;
	line-height: 1.3;
	font-weight: 800;
	color: #111;
}

.two-inbox-item-meta {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 9px;
	min-width: 0;
}

.two-inbox-timestamp {
	font-size: 12px;
	line-height: 1.3;
	font-weight: 650;
	color: #7a8190;
	white-space: nowrap;
}

.two-inbox-unread {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 999px;
	background: #ff7220;
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1;
}

.two-inbox-preview {
	margin: 8px 0 0 62px;
	font-size: 14px;
	line-height: 1.45;
	font-weight: 500;
	color: #4f5663;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.two-inbox-item.is-unread .two-inbox-preview {
	font-weight: 650;
	color: #2d2d35;
}

.two-inbox-empty {
	padding: 28px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
	text-align: center;
}

.two-inbox-empty strong {
	display: block;
	margin-bottom: 7px;
	font-size: 18px;
	font-weight: 800;
	color: #111;
}

.two-inbox-empty p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: #666;
}

.two-inbox-empty a,
.two-inbox-empty a:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 18px;
	padding: 9px 16px;
	border-radius: 999px;
	background: #ff7220;
	color: #fff !important;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none !important;
}

.two-inbox-empty a:hover,
.two-inbox-empty a:focus {
	background: #dd5d14;
	color: #fff !important;
	text-decoration: none !important;
}

@media (max-width: 640px) {
	.two-inbox {
		max-width: 100%;
		padding-top: 4px;
	}

	.two-inbox-header {
		align-items: center;
		gap: 14px;
		margin-bottom: 20px;
	}

	.two-inbox-heading-group h2 {
		font-size: 32px;
	}

	.two-inbox-heading-group p {
		display: none;
	}

	.two-inbox-new-message,
	.two-inbox-new-message:visited {
		min-height: 34px;
		padding: 8px 12px;
		font-size: 12px;
	}

	.two-inbox-list a.two-inbox-item,
	.two-inbox-list a.two-inbox-item:visited {
		padding: 14px 14px 14px 16px;
		border-radius: 16px;
	}

	.two-inbox-item-header {
		gap: 10px;
	}

	.two-inbox .two-member-identity-avatar {
		width: 44px;
		height: 44px;
		flex-basis: 44px;
	}

	.two-inbox .two-member-identity-name {
		font-size: 15px;
	}

	.two-inbox-item-meta {
		flex-direction: column;
		align-items: flex-end;
		gap: 6px;
	}

	.two-inbox-timestamp {
		max-width: 92px;
		white-space: normal;
		text-align: right;
	}

	.two-inbox-preview {
		margin-left: 56px;
		font-size: 13px;
	}

	.two-inbox-empty {
		padding: 24px 18px;
	}
}

/* =========================================
   TWO PLATFORM — CONVERSATION
========================================= */

.two-conversation {
	max-width: 820px;
	margin: 0 auto;
	padding: 10px 0 48px;
}

.two-conversation-back,
.two-conversation-back:visited {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 18px;
	color: #555 !important;
	font-size: 14px;
	font-weight: 750;
	line-height: 1;
	text-decoration: none !important;
	transition: color 0.18s ease, transform 0.18s ease;
}

.two-conversation-back:hover,
.two-conversation-back:focus {
	color: #111 !important;
	text-decoration: none !important;
	transform: translateX(-2px);
	outline: none;
}

.two-conversation-header {
	margin-bottom: 28px;
	padding: 22px 24px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.two-conversation-header-kicker {
	margin-bottom: 12px;
	font-size: 12px;
	font-weight: 850;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #777;
}

.two-conversation-header-identity .two-member-identity-message {
	margin: 0;
}

.two-conversation-header-identity .two-member-identity-avatar {
	width: 56px;
	height: 56px;
	flex-basis: 56px;
}

.two-conversation-header-identity .two-member-identity-name {
	font-size: 19px;
	font-weight: 850;
}

.two-conversation-header-identity .two-member-identity-badge,
.two-conversation-header-identity .two-member-identity-status {
	font-size: 11px;
	font-weight: 800;
}

.two-conversation-empty {
	margin-bottom: 22px;
	padding: 26px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
	text-align: center;
}

.two-conversation-empty strong {
	display: block;
	margin-bottom: 6px;
	font-size: 18px;
	font-weight: 800;
	color: #111;
}

.two-conversation-empty p {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #666;
}

.two-conversation-messages {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 4px 0 8px;
}

.two-conversation-message {
	display: flex;
	flex-direction: column;
	width: min(72%, 560px);
}

.two-conversation-message-other {
	align-self: flex-start;
	align-items: flex-start;
}

.two-conversation-message-own {
	align-self: flex-end;
	align-items: flex-end;
}

.two-conversation-message.is-group-start {
	margin-top: 15px;
}

.two-conversation-message:first-child {
	margin-top: 0;
}

.two-conversation-message-identity {
	margin: 0 0 8px;
}

.two-conversation-message-own .two-conversation-message-identity {
	align-self: flex-end;
}

.two-conversation-message-identity .two-member-identity-message {
	margin: 0;
}

.two-conversation-message-identity .two-member-identity-avatar {
	width: 38px;
	height: 38px;
	flex-basis: 38px;
}

.two-conversation-message-identity .two-member-identity-name {
	font-size: 13px;
	font-weight: 800;
}

.two-conversation-message-identity .two-member-identity-badge,
.two-conversation-message-identity .two-member-identity-status {
	margin-top: 3px;
	padding: 3px 7px;
	font-size: 10px;
}

.two-conversation-bubble {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	padding: 13px 15px 9px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px 18px 18px 6px;
	background: #fff;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.two-conversation-message-own .two-conversation-bubble {
	border-color: #ffd5bd;
	border-radius: 18px 18px 6px 18px;
	background: #fff3e8;
}

.two-conversation-message.is-group-continuation .two-conversation-bubble {
	border-top-left-radius: 10px;
}

.two-conversation-message-own.is-group-continuation .two-conversation-bubble {
	border-top-left-radius: 18px;
	border-top-right-radius: 10px;
}

.two-conversation-bubble p {
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
	font-weight: 500;
	color: #2d2d35;
	white-space: pre-wrap;
	word-break: break-word;
}

.two-conversation-timestamp {
	margin-top: 6px;
	font-size: 11px;
	line-height: 1.3;
	font-weight: 650;
	color: #8a909b;
}

.two-conversation-message-own .two-conversation-timestamp {
	text-align: right;
}

/* =========================================
   TWO PLATFORM — REPLY COMPOSER
========================================= */

.two-conversation-reply-form {
	margin-top: 28px;
	padding: 20px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.two-conversation-reply-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.two-conversation-reply-form label {
	display: block;
	margin: 0;
	font-size: 14px;
	font-weight: 800;
	color: #111;
}

.two-conversation-reply-form textarea {
	width: 100%;
	min-height: 112px;
	padding: 13px 14px;
	border: 1px solid #d8d8d8;
	border-radius: 12px;
	background: #fff;
	color: #111;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	resize: vertical;
	box-sizing: border-box;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.two-conversation-reply-form textarea:focus {
	border-color: #ff7220;
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 114, 32, 0.15);
}

.two-conversation-reply-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

.two-conversation-reply-form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 9px 18px;
	border: 1px solid #ff7220;
	border-radius: 999px;
	background: #ff7220;
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.two-conversation-reply-form button:hover,
.two-conversation-reply-form button:focus {
	background: #dd5d14;
	border-color: #dd5d14;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
	outline: none;
}

.two-conversation-reply-form button:active {
	transform: translateY(0);
}

/* Layout: Conversation */

.two-member-identity-message {
	margin-bottom: 8px;
}

@media (max-width: 640px) {
	.two-conversation {
		max-width: 100%;
		padding-top: 4px;
	}

	.two-conversation-back,
	.two-conversation-back:visited {
		margin-bottom: 15px;
	}

	.two-conversation-header {
		margin-bottom: 20px;
		padding: 18px;
		border-radius: 16px;
	}

	.two-conversation-header-identity .two-member-identity-avatar {
		width: 48px;
		height: 48px;
		flex-basis: 48px;
	}

	.two-conversation-header-identity .two-member-identity-name {
		font-size: 17px;
	}

	.two-conversation-messages {
		gap: 6px;
	}

	.two-conversation-message {
		width: 90%;
	}

	.two-conversation-message.is-group-start {
		margin-top: 12px;
	}

	.two-conversation-message-identity .two-member-identity-avatar {
		width: 34px;
		height: 34px;
		flex-basis: 34px;
	}

	.two-conversation-bubble {
		padding: 11px 13px 8px;
		border-radius: 16px 16px 16px 5px;
	}

	.two-conversation-message-own .two-conversation-bubble {
		border-radius: 16px 16px 5px 16px;
	}

	.two-conversation-bubble p {
		font-size: 14px;
		line-height: 1.5;
	}

	.two-conversation-timestamp {
		font-size: 10px;
	}

	.two-conversation-reply-form {
		margin-top: 22px;
		padding: 16px;
		border-radius: 16px;
	}

	.two-conversation-reply-form textarea {
		min-height: 104px;
	}
}

/* ==========================================================
   COMMUNICATION — Unified Message Composer v1.0.0
========================================================== */

body.two-message-modal-open {
	overflow: hidden;
}

.two-message-composer-page {
	max-width: 760px;
	margin: 0 auto;
	padding: 26px 0 52px;
}

.two-message-composer-card,
.two-message-modal-dialog {
	background: #ffffff;
	border: 1px solid var(--two-border, rgba(0,0,0,.08));
	border-radius: 20px;
	box-shadow: 0 18px 48px rgba(0,0,0,.14);
}

.two-message-composer-card {
	padding: 30px;
}

.two-message-composer-heading {
	margin-bottom: 24px;
}

.two-message-composer-kicker {
	display: block;
	margin-bottom: 6px;
	color: var(--two-secondary, #53807E);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.two-message-composer-heading h2,
.two-message-modal-header h2 {
	margin: 0;
	color: var(--two-text, #2D2D35);
	font-size: 30px;
	font-weight: 800;
	line-height: 1.15;
}

.two-message-composer-heading p {
	margin: 9px 0 0;
	color: var(--two-text-light, #777);
	font-size: 15px;
	line-height: 1.5;
}

.two-message-composer-form {
	display: grid;
	gap: 20px;
}

.two-message-composer-field {
	display: grid;
	gap: 8px;
}

.two-message-composer-field label {
	color: var(--two-text, #2D2D35);
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.two-message-composer-field select,
.two-message-composer-field textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid rgba(0,0,0,.14);
	border-radius: 12px;
	background: #ffffff;
	color: var(--two-text, #2D2D35);
	font: inherit;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.two-message-composer-field select {
	min-height: 48px;
	padding: 0 14px;
}

.two-message-composer-field textarea {
	min-height: 180px;
	padding: 14px 16px;
	line-height: 1.6;
	resize: vertical;
}

.two-message-composer-field textarea::placeholder {
	color: #9a9a9a;
}

.two-message-composer-field select:focus,
.two-message-composer-field textarea:focus {
	border-color: var(--two-secondary, #53807E);
	outline: none;
	box-shadow: 0 0 0 3px rgba(83,128,126,.16);
}

.two-message-composer-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding-top: 2px;
}

.two-message-composer-cancel,
.two-message-composer-cancel:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	background: transparent;
	color: var(--two-secondary, #53807E) !important;
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
	text-decoration: none !important;
	cursor: pointer;
}

.two-message-composer-cancel:hover,
.two-message-composer-cancel:focus {
	color: var(--two-secondary-hover, #3F6664) !important;
	text-decoration: none !important;
	outline: none;
}

.two-message-composer-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--two-primary, #FF7220);
	border-radius: 999px;
	background: var(--two-primary, #FF7220);
	color: #ffffff;
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.two-message-composer-submit:hover,
.two-message-composer-submit:focus {
	background: var(--two-primary-hover, #DD5D14);
	border-color: var(--two-primary-hover, #DD5D14);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 7px 18px rgba(0,0,0,.12);
	outline: none;
}

.two-message-modal[hidden] {
	display: none !important;
}

.two-message-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.two-message-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17,24,39,.48);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .16s ease;
}

.two-message-modal-dialog {
	position: relative;
	z-index: 1;
	width: min(680px, 100%);
	max-height: calc(100vh - 48px);
	overflow: auto;
	padding: 26px;
	opacity: 0;
	transform: translateY(12px) scale(.985);
	transition: opacity .16s ease, transform .16s ease;
}

.two-message-modal.is-open .two-message-modal-backdrop {
	opacity: 1;
}

.two-message-modal.is-open .two-message-modal-dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.two-message-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.two-message-modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	padding: 0;
	border: 1px solid rgba(0,0,0,.12);
	border-radius: 999px;
	background: #ffffff;
	color: #555;
	font-size: 24px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.two-message-modal-close:hover,
.two-message-modal-close:focus {
	background: var(--two-secondary, #53807E);
	border-color: var(--two-secondary, #53807E);
	color: #ffffff;
	transform: translateY(-1px);
	outline: none;
}

@media (max-width: 640px) {
	.two-message-composer-page {
		padding: 12px 0 32px;
	}

	.two-message-composer-card {
		padding: 22px;
		border-radius: 16px;
	}

	.two-message-modal {
		align-items: flex-end;
		padding: 0;
	}

	.two-message-modal-dialog {
		width: 100%;
		max-height: 92vh;
		padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
		border-radius: 20px 20px 0 0;
	}

	.two-message-composer-heading h2,
	.two-message-modal-header h2 {
		font-size: 26px;
	}

	.two-message-composer-field textarea {
		min-height: 150px;
	}

	.two-message-composer-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.two-message-composer-cancel,
	.two-message-composer-submit {
		width: 100%;
	}
}