/*
Responsive and accessible refinements for the standalone ELVI applications
panel. This file is injected only into the panel template.
*/

:root {
	/* [brand-fix 2026-07-26] Use the real ELVI brand green (#72b844), not the off-brand dark forest
	   green Codex used; keep a subtle darker shade only for hover/active. Matches the public site. */
	--panel-green: #72b844;
	--panel-green-dark: #5f9e39;
	--panel-ink: #252428;
	--panel-muted: #626164;
	--panel-border: #d7d7d7;
	--panel-surface: #f6f7f5;
	--panel-error: #b4232f;
	--panel-focus: #185fa8;
	--panel-radius: 7px;
	--panel-shadow: 0 14px 38px rgba(29, 43, 25, 0.14);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	min-width: 320px;
	min-height: 100%;
	background: #fff;
}

body {
	min-width: 320px;
	min-height: 100%;
	height: auto;
	color: var(--panel-ink);
	line-height: 1.5;
	overflow-x: hidden;
}

body.panel-dialog-open {
	overflow: hidden;
}

a {
	text-underline-offset: 0.18em;
}

img {
	max-width: 100%;
	height: auto;
}

:where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
	outline: 3px solid var(--panel-focus) !important;
	outline-offset: 3px !important;
}

.header :where(a, button):focus-visible {
	outline-color: #fff !important;
	box-shadow: 0 0 0 6px rgba(18, 51, 24, 0.68);
}

/* Panel header and tab navigation. */
.header {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr) auto;
	align-items: center;
	gap: 14px;
	min-height: 72px;
	padding: 6px 18px;
	background: var(--panel-green);
}

.header div.logo {
	position: static;
	width: 90px;
	height: 58px;
	background-size: 68px;
}

.header ul {
	display: flex;
	min-width: 0;
	margin: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
	text-align: left;
	-webkit-overflow-scrolling: touch;
}

.header ul li {
	flex: 0 0 auto;
	margin: 0 4px;
}

.header ul li a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	height: auto;
	padding: 8px 12px;
	line-height: 1.25;
	border-radius: 3px;
}

.header ul li.current a,
.header ul li a:hover {
	color: var(--panel-green-dark);
	background: #fff;
}

.header .user {
	position: static;
	display: flex;
	align-items: center;
	padding: 0;
}

.header .user p,
.header .user a {
	display: inline-flex;
	align-items: center;
	float: none;
	min-height: 48px;
	height: auto;
	margin-left: 12px;
	line-height: 1.3;
}

.header .user p {
	max-width: 190px;
	padding-left: 36px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.header .user a.logout {
	padding: 8px 16px;
	border-radius: 3px;
}

.header .user a.logout:hover,
.header .user a.logout:active {
	color: var(--panel-green-dark);
	background: #fff;
}

/* Application lists and record cards. */
.layout {
	width: min(1366px, 100%);
	margin: 0 auto;
	padding: clamp(32px, 6vw, 80px);
}

.layout .content h2 {
	margin-bottom: clamp(24px, 4vw, 40px);
	color: var(--panel-ink);
	font-size: clamp(26px, 4vw, 36px);
	line-height: 1.2;
}

.layout .content .data {
	margin-top: clamp(30px, 6vw, 72px);
}

.layout .content .data .block {
	margin-top: 20px;
	padding: 22px;
	overflow: visible;
	background: #fff;
	border: 1px solid var(--panel-border);
	border-radius: var(--panel-radius);
	box-shadow: 0 5px 18px rgba(29, 43, 25, 0.06);
}

.layout .content .data .block:first-child {
	border-top: 1px solid var(--panel-border);
}

.layout .content .data .block .top {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(160px, 0.7fr) auto;
	gap: 16px;
	align-items: center;
	overflow: visible;
}

.layout .content .data .block .top .item,
.layout .content .data .block .item {
	float: none;
	width: auto;
	min-width: 0;
	padding: 8px;
	overflow-wrap: anywhere;
}

.layout .content .data .block .top .item a.view {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: none;
	min-width: 110px;
	min-height: 44px;
	height: auto;
	padding: 8px 20px;
	color: var(--panel-ink);
	line-height: 1.2;
	border: 2px solid var(--panel-ink);
}

.layout .content .data .block .top .item:last-child {
	text-align: right;
}

.layout .content .data .block.show-fields .top .item a.view {
	color: var(--panel-error);
	border-color: var(--panel-error);
}

.layout .content .data .block .fields {
	display: none;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-top: 22px;
	padding: clamp(18px, 4vw, 38px);
	overflow: visible;
	background: var(--panel-surface);
	border-radius: var(--panel-radius);
}

.layout .content .data .block.show-fields .fields {
	display: grid;
}

.layout .content .data .block .fields .item {
	float: none;
	width: auto;
	padding: 12px;
}

.layout .content .data .block .fields .item.source,
.layout .content .data .block .fields .item.text,
.layout .content .data .block .fields .delete-post {
	grid-column: 1 / -1;
	width: auto;
}

.layout .content .data .block .fields .item:nth-child(3n + 1) {
	clear: none;
}

.layout .content .data .block .item p,
.layout .content .data .block .item span,
.layout .content .data .block .item a {
	font-size: 14px;
	line-height: 1.55;
}

.layout .content .data .block .item a {
	min-height: 44px;
	height: auto;
	color: var(--panel-green);
}

.layout .content .data .block .item a.attachment {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	height: auto;
	padding: 9px 18px;
	color: #fff;
	line-height: 1.3;
	background: var(--panel-green);
}

.layout .content .data .block .item a.attachment:hover,
.layout .content .data .block .item a.attachment:active {
	background: var(--panel-green-dark);
}

.layout .content .data .block .fields .delete-post {
	padding-top: 12px;
	text-align: right;
}

.layout .content .data .block .fields .delete-post a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	height: auto;
	padding: 7px 10px;
	color: var(--panel-error);
	line-height: 1.3;
}

/* Login view. */
.login-page {
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	height: auto;
	padding: clamp(20px, 5vw, 48px);
	overflow-x: hidden;
	overflow-y: auto;
	background:
		linear-gradient(rgba(248, 249, 247, 0.94), rgba(248, 249, 247, 0.94)),
		linear-gradient(135deg, #e8f1e2, #fff);
}

.login-page .table,
.login-page .table .cell {
	min-height: calc(100vh - 40px);
	min-height: calc(100dvh - 40px);
}

.login-page .table .cell {
	padding: 24px 0;
}

.login-page img {
	width: 118px;
	margin-bottom: 28px;
}

.panel-login-title {
	margin: 0 0 20px;
	color: var(--panel-ink);
	font-size: clamp(26px, 6vw, 34px);
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

#loginform {
	width: min(400px, 100%);
	margin: 0 auto;
	padding: clamp(24px, 6vw, 38px);
	background: #fff;
	border: 1px solid var(--panel-border);
	border-radius: 10px;
	box-shadow: var(--panel-shadow);
}

#loginform p {
	margin-top: 20px;
}

#loginform label {
	margin-bottom: 8px;
	color: var(--panel-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

#loginform input.input {
	width: 100%;
	min-height: 50px;
	padding: 11px 14px;
	color: var(--panel-ink);
	font-size: 16px;
	line-height: 1.35;
	background: #fff;
	border: 1px solid #aaa;
	border-radius: 4px;
}

#loginform input.input:focus {
	border: 2px solid var(--panel-green);
}

#loginform .login-remember label {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin: 0;
	cursor: pointer;
}

#loginform #rememberme {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin: 0 10px 0 0;
	accent-color: var(--panel-green);
}

#loginform .login-submit {
	margin-top: 22px;
}

#loginform #wp-submit {
	width: 100%;
	min-height: 50px;
	padding: 10px 18px;
	color: #fff;
	font: 700 16px/1.3 "Open Sans", sans-serif;
	background: var(--panel-green);
	border: 2px solid var(--panel-green);
	border-radius: 4px;
	cursor: pointer;
}

#loginform #wp-submit:hover,
#loginform #wp-submit:active {
	background: var(--panel-green-dark);
	border-color: var(--panel-green-dark);
}

/* Delete confirmation and loading states. */
.message {
	z-index: 1000;
	padding: 20px;
	overflow-x: hidden;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.64);
}

.message .message-wrapper {
	width: min(440px, 100%);
	max-width: none;
	padding: clamp(26px, 6vw, 48px);
	border-radius: var(--panel-radius);
	box-shadow: var(--panel-shadow);
}

.message .message-wrapper p {
	color: var(--panel-ink);
	font-size: clamp(18px, 4vw, 21px);
	line-height: 1.4;
}

.message .message-wrapper .answer {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	max-width: 260px;
	margin-top: 26px;
	overflow: visible;
}

.message .message-wrapper .answer a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: none;
	width: auto;
	min-height: 48px;
	height: auto;
	padding: 9px 16px;
	line-height: 1.3;
	border-radius: 3px;
}

.message .message-wrapper .answer a.accept {
	background: var(--panel-green);
}

.message .message-wrapper .answer a.cancel {
	background: var(--panel-error);
}

.message .message-wrapper .answer a:hover,
.message .message-wrapper .answer a:active {
	background: var(--panel-ink) !important;
}

.preloader {
	background: rgba(0, 0, 0, 0.58);
}

.preloader span {
	width: 64px;
	height: 64px;
	box-shadow: var(--panel-shadow);
}

.panel-notice,
.panel-error {
	max-width: 760px;
	margin: 16px auto;
	padding: 14px 16px;
	color: var(--panel-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	background: #fff;
	border-left: 4px solid var(--panel-error);
	border-radius: 3px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.panel-dialog-status {
	margin: 18px 0 0;
	padding: 10px 12px;
	color: var(--panel-error);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
	background: #fff5f5;
	border-left: 4px solid var(--panel-error);
}

@media only screen and (max-width: 900px) {
	.header {
		grid-template-columns: 90px minmax(0, 1fr);
	}

	.header .user {
		grid-column: 1 / -1;
		justify-content: flex-end;
		padding: 0 4px 4px;
	}

	.layout .content .data .block .fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media only screen and (max-width: 680px) {
	.header {
		display: flex;
		flex-wrap: wrap;
		gap: 4px 10px;
		padding: 8px 12px;
	}

	.header div.logo {
		flex: 0 0 74px;
		width: 74px;
		height: 52px;
		background-size: 62px;
	}

	.header .user {
		flex: 1 1 auto;
		justify-content: flex-end;
		min-width: 0;
		padding: 0;
	}

	.header .user p {
		max-width: 120px;
		margin-left: 0;
		padding-left: 30px;
		background-size: 26px;
	}

	.header .user a {
		margin-left: 4px;
	}

	.header ul {
		order: 3;
		flex: 1 0 100%;
		width: 100%;
		padding-top: 4px;
		border-top: 1px solid rgba(255, 255, 255, 0.25);
	}

	.header ul li:first-child {
		margin-left: 0;
	}

	.layout {
		padding: 28px 14px 44px;
	}

	.layout .content .data .block {
		padding: 16px;
	}

	.layout .content .data .block .top {
		grid-template-columns: minmax(0, 1fr);
		gap: 6px;
	}

	.layout .content .data .block .top .item,
	.layout .content .data .block .top .item:last-child {
		width: 100%;
		padding: 6px 0;
		text-align: left;
	}

	.layout .content .data .block .fields {
		grid-template-columns: minmax(0, 1fr);
		padding: 14px;
	}

	.layout .content .data .block .fields .item {
		grid-column: 1 / -1;
		padding: 10px 4px;
	}

	.layout .content .data .block .fields .delete-post {
		text-align: left;
	}
}

@media only screen and (max-width: 420px) {
	.header .user p {
		display: none;
	}

	#loginform {
		padding: 24px 18px;
	}

	.message {
		padding: 12px;
	}

	.message .message-wrapper .answer {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto !important;
	}

	*,
	*::before,
	*::after {
		animation-delay: 0s !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-delay: 0s !important;
		transition-duration: 0.01ms !important;
	}
}

@media (forced-colors: active) {
	:where(a, button, input, select, textarea, [role="button"]):focus-visible {
		outline-color: Highlight !important;
	}
}
