/*
 * Meristem account area, part 5: the Messages page's box first, the
 * conversation (MessageThread) with new replies standing out, the Support
 * bubble's place on the Messages page, and the "My box arrived" button.
 * Loads after account-schedule.css.
 *
 * Contrast: Ink on Sage Wash 14.2:1 (care team), Ink on Oat 15.1:1 (you),
 * Bark on either 8.3:1+ (names and times), Walnut on Card 6.0:1 (order line
 * and the notes under the box), Bone on Fir 9.6:1 (the "New" tag), Fir on
 * Card 10.3:1 (the new-reply count), the Fir edge on Sage Wash 8.6:1.
 */

/* 0. The box first --------------------------------------------------------------
 * Run 11: the page opened on two paragraphs, then the box, then the list
 * ("I did not know where to look"). On the Messages page the card shows its
 * title, the 911 line and the box, and its notes move under the Send button
 * in smaller type. Only the order on screen changes: screen readers still
 * hear the notes first, and the tab order (the form) is the same. */

.pwp-acct--messages .pwp-acct-message {
	display: flex;
	flex-direction: column;
}

.pwp-acct--messages .pwp-acct-message > .pwp-acct-alert {
	order: 1;
	margin: 0 0 16px;
}

.pwp-acct--messages .pwp-acct-message > form {
	order: 2;
	margin: 0;
}

.pwp-acct--messages .pwp-acct-message > p:not(.pwp-acct-eyebrow):not(.pwp-acct-alert) {
	order: 3;
	margin: 12px 0 0;
	color: var(--acct-walnut);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* 1. Conversation, newest first under the message form ---------------------- */

.pwp-acct-card .pwp-thread__order {
	margin: -4px 0 16px;
	color: var(--acct-walnut);
	font-size: 0.9375rem;
}

.pwp-thread__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pwp-thread__item {
	max-width: 88%;
	padding: 12px 14px;
	border-radius: 14px;
	color: var(--acct-ink);
}

.pwp-thread__item--team {
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	background: var(--acct-sage-wash);
}

.pwp-thread__item--you {
	align-self: flex-end;
	border-bottom-right-radius: 4px;
	background: var(--acct-oat);
}

.pwp-acct-card .pwp-thread__meta {
	margin: 0 0 4px;
	color: var(--acct-bark);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.pwp-thread__who {
	font-weight: 600;
}

.pwp-acct-card .pwp-thread__text {
	margin: 0;
	font-size: 1rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.pwp-thread__text--photo {
	font-style: italic;
}

/* A reply the patient hasn't seen yet: the count above the list, a "New" tag
   (words, not only color) and a fir edge on the bubble. */
.pwp-acct-card .pwp-thread__unread {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: -4px 0 8px;
	color: var(--acct-fir);
	font-size: 1rem;
	font-weight: 600;
}

.pwp-acct-card .pwp-thread__unread::before {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--acct-copper);
}

.pwp-thread__item--new {
	box-shadow: inset 0 0 0 2px var(--acct-fir);
}

.pwp-thread__new {
	display: inline-block;
	margin-right: 4px;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--acct-fir);
	color: var(--acct-bone);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.6;
	text-transform: uppercase;
}

@media (forced-colors: active) {
	.pwp-thread__item--new {
		outline: 2px solid CanvasText;
	}

	.pwp-thread__new {
		border: 1px solid CanvasText;
	}
}

/* The newest reply links back up to the form. */
.pwp-acct-card .pwp-thread__actions {
	margin: 4px 0 0;
}

.pwp-acct-card a.pwp-thread__write-back {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-weight: 600;
	touch-action: manipulation;
}

/* A kept draft: the line above the text put back in the box (DraftKeeper).
   Ink on Sage Wash 14.2:1. */
.pwp-acct-card .pwp-draft-note {
	margin: 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--acct-sage-wash);
	color: var(--acct-ink);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* 2. The Support bubble on this page -------------------------------------------
 * The message form opens this page, so the floating bubble would pass over the
 * box and the Send button on a phone. Here it sits at the end of the page and
 * its panel opens upward from there. */

body.woocommerce-messages .pwp-support {
	position: relative;
	right: auto;
	bottom: auto;
	display: flex;
	justify-content: flex-end;
	margin: 0 16px 16px;
}

/* 3. "My box arrived" ---------------------------------------------------------- */

.pwp-arrival-form {
	margin: 0;
}

.pwp-next-dose .pwp-arrival-form {
	margin-top: 12px;
}

@media print {
	.pwp-arrival-form {
		display: none;
	}
}
