/**
 * plugins/generic/pjcrHelpDesk/css/pjcrHelpDesk.css
 *
 * PJCR HelpDesk - public widget styles.
 * No external font, no external asset. Inherits the journal's own font stack.
 */

.pjcr-hd {
	/* Palette taken from the PJCR master stylesheet so the widget reads as part of
	   the journal rather than a bolt-on: slate tint, #d1d5db borders, 6px radius,
	   and the Open Access orange used for article labels. */
	--pjcr-accent: #5BA85A;          /* light green - header, launcher, buttons */
	--pjcr-accent-dark: #478C48;     /* hover / focus */
	--pjcr-oa: #3E7B41;              /* section labels */
	--pjcr-text: #23282d;
	--pjcr-muted: #5b6770;
	--pjcr-border: #C8E6C9;          /* soft green border */
	--pjcr-bot-bg: #E8F5E9;          /* bot bubble tint */
	--pjcr-panel-bg: #F4FAF5;        /* the window itself */

	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.55;
	color: var(--pjcr-text);
}

/* ---------- Isolation from the journal's global rules ----------
   The PJCR stylesheet justifies <p> inside most containers and applies a number of
   !important layout rules. These guards keep those from reaching inside the panel,
   where justified text in a ~380px column looks broken. */

.pjcr-hd,
.pjcr-hd * {
	box-sizing: border-box;
}

.pjcr-hd p,
.pjcr-hd li,
.pjcr-hd div,
.pjcr-hd .pjcr-hd__answer,
.pjcr-hd .pjcr-hd__bubble {
	text-align: left !important;
	font-style: normal !important;
	letter-spacing: normal !important;
}

.pjcr-hd .pjcr-hd__title::after,
.pjcr-hd .pjcr-hd__title::before {
	content: none !important;
}

.pjcr-hd ul,
.pjcr-hd ol {
	list-style: initial;
}

.pjcr-hd ol {
	list-style: decimal;
}

.pjcr-hd--bottom-right { right: 20px; }
.pjcr-hd--bottom-left { left: 20px; }

/* Launcher ---------------------------------------------------------- */

.pjcr-hd__launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	height: 52px;
	padding: 0 20px 0 17px;
	border: 0;
	border-radius: 999px;
	background: var(--pjcr-accent);
	color: #fff;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: .2px;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
	transition: transform .15s ease, background-color .15s ease;
}

.pjcr-hd__launcher-label {
	line-height: 1;
}

.pjcr-hd__launcher:hover { background: var(--pjcr-accent-dark); transform: translateY(-2px); }
.pjcr-hd__launcher:focus-visible,
.pjcr-hd__launcher:focus { outline: 3px solid var(--pjcr-accent-dark); outline-offset: 3px; }
.pjcr-hd__launcher-icon { font-size: 20px; line-height: 1; }

/* Panel ------------------------------------------------------------- */

.pjcr-hd__panel {
	position: absolute;
	bottom: 68px;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: min(560px, calc(100vh - 120px));
	display: flex;
	flex-direction: column;
	background: var(--pjcr-panel-bg);
	border: 1px solid var(--pjcr-border);
	border-radius: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
	overflow: hidden;
}

.pjcr-hd--bottom-right .pjcr-hd__panel { right: 0; }
.pjcr-hd--bottom-left .pjcr-hd__panel { left: 0; }
.pjcr-hd__panel[hidden] { display: none; }

.pjcr-hd__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--pjcr-accent);
	color: #fff;
}

.pjcr-hd__header-text { display: flex; flex-direction: column; min-width: 0; }
.pjcr-hd__title { font-weight: 700; font-size: 16px; }
.pjcr-hd__subtitle { font-size: 12px; opacity: .9; }

.pjcr-hd__close {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 6px;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.pjcr-hd__close:hover { background: rgba(255, 255, 255, .3); }
.pjcr-hd__close:focus-visible,
.pjcr-hd__close:focus { outline: 2px solid #fff; outline-offset: 2px; }

/* Log --------------------------------------------------------------- */

.pjcr-hd__log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	background: var(--pjcr-panel-bg);
}

.pjcr-hd__log:focus-visible { outline: 2px solid var(--pjcr-accent); outline-offset: -2px; }

.pjcr-hd__msg { display: flex; margin-bottom: 10px; }
.pjcr-hd__msg--bot { justify-content: flex-start; }
.pjcr-hd__msg--user { justify-content: flex-end; }

.pjcr-hd__bubble {
	max-width: 88%;
	padding: 12px 14px;
	border-radius: 6px;
	background: var(--pjcr-bot-bg);
	border: 1px solid var(--pjcr-border);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .02);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.pjcr-hd__msg--user .pjcr-hd__bubble {
	background: var(--pjcr-accent);
	border-color: var(--pjcr-accent);
	color: #fff;
}

.pjcr-hd__answer-q { font-weight: 700; margin-bottom: 6px; }
.pjcr-hd__answer p { margin: 0 0 8px; }
.pjcr-hd__answer p:last-child { margin-bottom: 0; }
.pjcr-hd__answer ul,
.pjcr-hd__answer ol { margin: 0 0 8px; padding-left: 20px; }
.pjcr-hd__answer a { color: var(--pjcr-accent-dark); text-decoration: underline; }

/* Chips ------------------------------------------------------------- */

.pjcr-hd__chips { margin: 0 0 12px; }
.pjcr-hd__chips-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .8px;
	color: var(--pjcr-oa);
	margin-bottom: 6px;
}

.pjcr-hd__chip {
	display: inline-block;
	margin: 0 6px 6px 0;
	padding: 7px 12px;
	border: 1px solid var(--pjcr-accent);
	border-radius: 6px;
	background: #fff;
	color: var(--pjcr-accent-dark);
	font-size: 13.5px;
	font-family: inherit;
	cursor: pointer;
	text-align: left;
}

.pjcr-hd__chip:hover { background: var(--pjcr-accent); color: #fff; }
.pjcr-hd__chip:focus-visible,
.pjcr-hd__chip:focus { outline: 2px solid var(--pjcr-accent-dark); outline-offset: 2px; }

.pjcr-hd__contact {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 6px;
	background: var(--pjcr-accent);
	color: #fff !important;
	text-decoration: none;
	font-size: 14px;
}

.pjcr-hd__contact:hover { background: var(--pjcr-accent-dark); }

/* Footer ------------------------------------------------------------ */

.pjcr-hd__footer {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--pjcr-border);
	background: var(--pjcr-panel-bg);
}

.pjcr-hd__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 12px;
	border: 1px solid var(--pjcr-border);
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	color: var(--pjcr-text);
	background: #fff;
}

.pjcr-hd__input:focus { border-color: var(--pjcr-accent); outline: 2px solid var(--pjcr-accent); outline-offset: 1px; }

.pjcr-hd__send {
	flex: 0 0 auto;
	width: 42px;
	border: 0;
	border-radius: 6px;
	background: var(--pjcr-accent);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
}

.pjcr-hd__send:hover { background: var(--pjcr-accent-dark); }
.pjcr-hd__send:disabled { opacity: .55; cursor: default; }
.pjcr-hd__send:focus-visible,
.pjcr-hd__send:focus { outline: 2px solid var(--pjcr-accent-dark); outline-offset: 2px; }

.pjcr-hd__disclaimer {
	margin: 0;
	padding: 8px 12px 10px;
	font-size: 11.5px;
	line-height: 1.45;
	color: var(--pjcr-muted);
	background: var(--pjcr-bot-bg);
	border-top: 1px solid var(--pjcr-border);
}

.pjcr-hd__disclaimer[hidden] { display: none; }

/* Mobile ------------------------------------------------------------ */

@media (max-width: 520px) {
	.pjcr-hd { bottom: 14px; }
	.pjcr-hd--bottom-right { right: 14px; }
	.pjcr-hd--bottom-left { left: 14px; }

	.pjcr-hd__panel {
		position: fixed;
		left: 8px;
		right: 8px;
		bottom: 84px;
		width: auto;
		max-width: none;
		max-height: calc(100vh - 130px);
		max-height: calc(100dvh - 130px);
	}

	.pjcr-hd__input { font-size: 16px; } /* prevents iOS zoom-on-focus */

	.pjcr-hd__launcher { height: 48px; padding: 0 16px 0 14px; font-size: 13.5px; gap: 7px; }
	.pjcr-hd__panel { bottom: 78px; }
}

@media (prefers-reduced-motion: reduce) {
	.pjcr-hd__launcher { transition: none; }
}

@media (prefers-contrast: more) {
	.pjcr-hd__bubble { border-color: #000; }
}
