/**
 * A5 Inspector — loaded only when Inspector is enabled (theme options).
 *
 * html.a5-inspector-enabled: script/CSS loaded (PHP).
 * html.a5-inspector-active: overlay, outlines, gear buttons visible (toggle).
 */

/* —— Tagged regions (only when overlay ON) —— */
html.a5-inspector-active [data-a5] {
	outline: 1px solid #be3840;
	position: relative;
	overflow: visible;
}

/* —— GLOBAL / KOMPONENTE corner label (injected span; must sit above section backgrounds) —— */
.a5-inspector-category {
	box-sizing: border-box;
	position: absolute;
	top: -18px;
	left: -2px;
	z-index: 6;
	display: none;
	margin: 0;
	padding: 3px 8px;
	border: none;
	background: #be3840;
	color: #fff;
	font-size: 9px;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0.02em;
	pointer-events: none;
	/* Do not tie width to narrow parents (e.g. widgets on the right); cap by viewport only */
	max-width: min(380px, calc(100vw - 24px));
	white-space: normal;
	word-break: break-word;
	min-width: min(200px, calc(100vw - 24px));
}

html.a5-inspector-active [data-a5] .a5-inspector-category {
	display: inline-block;
}

/* —— Gear button —— */
.a5-inspector-btn {
	box-sizing: border-box;
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 7;
	display: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 1px solid #be3840;
	border-radius: 50%;
	background: #fff;
	color: #be3840;
	box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
	cursor: pointer;
	line-height: 0;
}

html.a5-inspector-active .a5-inspector-btn {
	display: flex;
}

.a5-inspector-gear svg {
	width: 14px;
	height: 14px;
	display: block;
}

.a5-inspector-btn:focus-visible {
	outline: 2px solid #be3840;
	outline-offset: 2px;
}

/* —— Bottom bar (same accent as [data-a5] outline) —— */
.a5-inspector-bar {
	box-sizing: border-box;
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 99998;
	display: none;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 8px 16px;
	border-top: 1px solid #be3840;
	background: #be3840;
	gap: 12px;
}

.a5-inspector-bar__left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.a5-inspector-bar__right {
	display: flex;
	align-items: center;
	gap: 22px;
}

.a5-inspector-bar__catalog-btn {
	flex-shrink: 0;
}

.a5-inspector-bar button {
	height: 28px;
	display: inline-flex;
	align-items: center;
}

.a5-inspector-switch {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	cursor: pointer;
}

.a5-inspector-switch input {
	cursor: pointer;
}

/* —— Kontrastanalyse (toggle from bar; html.a5-contrast-mode) —— */
.a5-contrast-box {
	box-sizing: border-box;
	position: absolute;
	pointer-events: none;
	border: 2px solid;
	font-size: 11px;
	z-index: 9999;
}

.a5-contrast-label {
	display: inline-block;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 2px 4px;
	font-size: 10px;
	line-height: 1.2;
}

.a5-contrast-aaa {
	border-color: #10b981;
}

.a5-contrast-aa {
	border-color: #f59e0b;
}

.a5-contrast-fail {
	border-color: #ef4444;
}

/* Inspector overlay off while contrast mode is on (class may be re-applied after cookie restore). */
html.a5-contrast-mode.a5-inspector-active [data-a5] {
	outline: none;
}

html.a5-contrast-mode.a5-inspector-active [data-a5] .a5-inspector-category,
html.a5-contrast-mode.a5-inspector-active .a5-inspector-btn {
	display: none !important;
}

html.a5-inspector-enabled .a5-inspector-bar {
	display: flex;
}

.a5-inspector-bar__logo {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.a5-inspector-bar__logo img {
	display: block;
	max-height: 32px;
	width: auto;
}

.a5-inspector-bar__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.a5-inspector-bar__toggle .form-check {
	margin-bottom: 0;
	min-height: auto;
}

.a5-inspector-bar__toggle label,
.a5-inspector-bar .form-check-label {
	margin: 0;
	font-size: 0.875rem;
	white-space: nowrap;
	cursor: pointer;
	color: #fff;
}

.a5-inspector-bar .form-check-label span {
	color: #fff;
}

.a5-inspector-bar .form-check-input {
	background-color: rgba(255, 255, 255, 0.25);
	border-color: rgba(255, 255, 255, 0.65);
}

.a5-inspector-bar .form-check-input:checked {
	background-color: #fff;
	border-color: #fff;
}

.a5-inspector-bar .form-check-input:focus {
	box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

/* —— Info panel —— */
.a5-inspector-panel {
	box-sizing: border-box;
	position: fixed;
	z-index: 99999;
	display: none;
	min-width: min(300px, calc(100vw - 32px));
	max-width: min(460px, calc(100vw - 32px));
	padding: 16px 18px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	font-size: 0.875rem;
	line-height: 1.45;
}

.a5-inspector-panel.is-open {
	display: block;
}

.a5-inspector-panel__title {
	margin: 0 0 10px;
	padding: 0;
	font-size: 1rem;
	font-weight: 600;
	color: #222;
}

.a5-inspector-panel__row {
	margin: 0 0 8px;
}

.a5-inspector-panel__row:last-child {
	margin-bottom: 0;
}

.a5-inspector-panel__label {
	margin: 0 0 2px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #666;
}

.a5-inspector-panel__value {
	margin: 0;
	color: #333;
}

.a5-inspector-panel__note code {
	padding: 0.1em 0.35em;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.06);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.88em;
}

.a5-inspector-panel__note strong {
	font-weight: 600;
}

.a5-inspector-panel__list {
	margin: 4px 0 0;
	padding-left: 1.1em;
}

.a5-inspector-panel__link {
	font-weight: 600;
	color: #be3840;
	text-decoration: underline;
}

.a5-inspector-panel__link:hover {
	color: #9a2d34;
}

/* Panel sits above the bar */
html.a5-inspector-enabled body {
	padding-bottom: 52px;
}

/* —— Settings catalog modal —— */
.a5-inspector-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	padding: 16px;
	background: rgba(0, 0, 0, 0.45);
}

.a5-inspector-modal.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
}

.a5-inspector-modal__box {
	width: min(960px, calc(100vw - 32px));
	max-height: min(80vh, 720px);
	overflow: hidden;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
}

.a5-inspector-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border-bottom: 1px solid #eee;
}

.a5-inspector-modal__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: #222;
}

.a5-inspector-modal__controls {
	padding: 10px 14px;
	border-bottom: 1px solid #eee;
}

.a5-inspector-modal__body {
	padding: 10px 14px;
	overflow: auto;
}

.a5-inspector-modal__footer {
	padding: 10px 14px 14px;
	border-top: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.a5-inspector-modal__footer-link {
	border: none;
	background: transparent;
	padding: 0;
	color: #be3840;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.8125rem;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.a5-inspector-modal__footer-link svg {
	width: 14px;
	height: 14px;
	display: block;
}

.a5-inspector-modal__status-title {
	margin: 0 0 8px;
	font-size: 0.95rem;
	font-weight: 700;
	color: #222;
}

.a5-inspector-modal__status-summary {
	margin: 0 0 12px;
}

.a5-inspector-modal__status-msg {
	margin: 0 0 12px;
	color: #333;
}

.a5-inspector-modal__status-desc {
	margin: 0 0 12px;
	color: #333;
	font-size: 0.8125rem;
}

.a5-inspector-modal__progress {
	height: 10px;
	border-radius: 999px;
	background: #edeffb;
	overflow: hidden;
}

.a5-inspector-modal__progress-inner {
	height: 100%;
	background: #be3840;
	width: 0%;
}

.a5-inspector-modal__status-tablewrap {
	overflow: auto;
}

.a5-inspector-modal__table {
	width: 100%;
	border-collapse: collapse;
}

.a5-inspector-modal__table th,
.a5-inspector-modal__table td {
	border: 1px solid #4b586f;
	padding: 8px 10px;
	vertical-align: top;
	background: #edeffb;
	color: #333;
	font-size: 0.8125rem;
}

.a5-inspector-modal__table th {
	background: #4b586f;
	color: #fff;
	font-weight: 600;
	position: sticky;
	top: 0;
}
.a5-inspector-modal__layout {
	display: grid;
	grid-template-columns: 180px 1fr;
	gap: 12px;
}

.a5-inspector-modal__nav {
	border-right: 1px solid #eee;
	padding-right: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.a5-inspector-modal__nav-btn {
	text-align: left;
	border: 1px solid #4b586f;
	background: #4b586f;
	border-radius: 6px;
	padding: 8px 10px;
	font-size: 0.875rem;
	cursor: pointer;
	color: #fff;
}

.a5-inspector-modal__nav-btn.is-active {
	border-color: #be3840;
	background: #be3840;
	font-weight: 600;
	color: #fff;
}

.a5-inspector-modal__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}

.a5-inspector-modal__tab-btn {
	border: 1px solid #4b586f;
	background: #4b586f;
	border-radius: 999px;
	padding: 6px 10px;
	font-size: 0.8125rem;
	cursor: pointer;
	color: #fff;
}

.a5-inspector-modal__tab-btn.is-active {
	border-color: #be3840;
	background: #be3840;
	font-weight: 600;
	color: #fff;
}

.a5-inspector-modal__tab-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin: 2px 0 10px;
}

.a5-inspector-modal__open-admin {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #be3840;
	text-decoration: underline;
}

.a5-inspector-modal__open-admin svg {
	width: 14px;
	height: 14px;
	display: block;
}

.a5-inspector-modal__list {
}

.a5-inspector-modal__item {
	padding: 10px 10px;
	border: 1px solid #4b586f;
	border-radius: 6px;
	margin-bottom: 10px;
	background: #edeffb;
	color: #333;
}

.a5-inspector-modal__item-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.a5-inspector-modal__item-meta {
	margin-top: 4px;
	font-size: 0.75rem;
	color: #666;
}

.a5-inspector-modal__item-sub {
	margin-top: 2px;
	font-size: 0.75rem;
	color: #999;
}
