/* Toolbox – Layout only; Schrift & Farben vom Theme / WP-Admin */

.toolbox-app {
	/* Theme-Tokens mit sinnvollen Fallbacks */
	--tb-ink: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, currentColor));
	--tb-muted: color-mix(in srgb, currentColor 62%, transparent);
	--tb-line: var(
		--wp--preset--color--cyan-bluish-gray,
		color-mix(in srgb, currentColor 18%, transparent)
	);
	--tb-surface: var(--wp--preset--color--base, var(--wp--preset--color--background, transparent));
	--tb-accent: var(
		--wp--preset--color--primary,
		var(--wp-admin-theme-color, var(--wp--preset--color--vivid-cyan-blue, currentColor))
	);
	--tb-accent-contrast: var(--wp--preset--color--base, #fff);
	--tb-radius: var(--wp--preset--border--radius, 4px);

	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	background: transparent;
}

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

.toolbox-app__intro {
	margin-bottom: 1rem;
	text-align: left;
}

.toolbox-app__title,
.toolbox-app h1,
.toolbox-app h2,
.toolbox-app h3 {
	font-family: inherit;
	color: inherit;
}

.toolbox-app__title,
.toolbox-app h1 {
	margin: 0 0 0.35rem;
	font-size: 1.6rem;
	line-height: 1.2;
	text-align: left;
}

.toolbox-app__lead {
	margin: 0;
	opacity: 0.75;
	text-align: left;
}

.toolbox-app__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 1rem;
	align-items: start;
	width: 100%;
}

.toolbox-app__sidebar,
.toolbox-app__form,
.toolbox-app__activehelp,
.toolbox-app__history,
.toolbox-app__card {
	background: transparent;
	border: 1px solid var(--tb-line);
	border-radius: var(--tb-radius);
}

.toolbox-app__sidebar {
	padding: 0.85rem;
}

.toolbox-app__sidebar-head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.35rem 1rem;
	margin-bottom: 0.75rem;
	align-items: baseline;
}

.toolbox-app__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.45rem;
	width: 100%;
}

.toolbox-app__toolbtn {
	appearance: none;
	-webkit-appearance: none;
	min-width: 0;
	width: 100%;
	max-width: none;
	background: transparent;
	border: 1px solid var(--tb-line);
	border-radius: var(--tb-radius);
	padding: 0.55rem;
	text-align: left;
	cursor: pointer;
	font: inherit;
	font-size: 0.85em;
	line-height: 1.25;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.toolbox-app .toolbox-app__toolbtn:hover,
.toolbox-app .toolbox-app__toolbtn:focus,
.toolbox-app .toolbox-app__toolbtn:focus-visible,
.toolbox-app button.toolbox-app__toolbtn:hover,
.toolbox-app button.toolbox-app__toolbtn:focus,
.toolbox-app button.toolbox-app__toolbtn:focus-visible {
	background: color-mix(in srgb, var(--tb-accent) 12%, transparent);
	border-color: var(--tb-accent);
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.toolbox-app .toolbox-app__toolbtn.is-active,
.toolbox-app .toolbox-app__toolbtn.is-active:hover,
.toolbox-app button.toolbox-app__toolbtn.is-active,
.toolbox-app button.toolbox-app__toolbtn.is-active:hover {
	background: color-mix(in srgb, var(--tb-accent) 18%, transparent);
	border-color: var(--tb-accent);
	box-shadow: inset 0 0 0 1px var(--tb-accent);
	font-weight: 600;
	color: inherit;
}

.toolbox-app__main {
	padding: 0;
	background: transparent;
	border: 0;
	box-shadow: none;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	min-width: 0;
}

.toolbox-app__form {
	padding: 1rem;
	margin: 0;
}

.toolbox-app__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.toolbox-app__host,
.toolbox-app__extra,
.toolbox-app__host-bulk,
.toolbox-app__submit,
.toolbox-app__fav,
.toolbox-app__export button,
.toolbox-app__history-item {
	font: inherit;
	color: inherit;
}

.toolbox-app__host,
.toolbox-app__extra,
.toolbox-app__host-bulk {
	min-height: 2.6rem;
	border-radius: var(--tb-radius);
	border: 1px solid var(--tb-line);
	padding: 0.45rem 0.75rem;
	background: transparent;
}

.toolbox-app__host {
	flex: 1 1 16rem;
	min-width: 12rem;
}

.toolbox-app__extra {
	flex: 0 1 12rem;
}

.toolbox-app__host-bulk {
	flex: 1 1 16rem;
	min-width: 12rem;
	min-height: 5rem;
	width: 100%;
}

.toolbox-app__submit {
	min-height: 2.6rem;
	border-radius: var(--tb-radius);
	border: 1px solid var(--tb-accent);
	padding: 0.45rem 1.1rem;
	background: var(--tb-accent);
	color: var(--tb-accent-contrast);
	cursor: pointer;
	font-weight: 600;
}

.toolbox-app__submit:hover {
	filter: brightness(0.95);
}

.toolbox-app__submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.toolbox-app__examples {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	align-items: center;
	margin: 0.85rem 0 0;
	opacity: 0.8;
	font-size: 0.92em;
}

.toolbox-app__example {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--tb-accent);
	cursor: pointer;
	font: inherit;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.toolbox-app__activehelp {
	padding: 0.9rem 1rem;
}

.toolbox-app__activehelp-title {
	font-weight: 700;
	margin-bottom: 0.45rem;
	color: inherit;
}

.toolbox-app__activehelp p {
	margin: 0 0 0.4rem;
	line-height: 1.45;
	font-size: 0.94em;
	color: inherit;
}

.toolbox-app__activehelp p:last-child {
	margin-bottom: 0;
}

.toolbox-app__status {
	margin: 0;
	padding: 0.7rem 0.85rem;
	border-radius: var(--tb-radius);
	border: 1px solid var(--tb-line);
	border-left-width: 4px;
	border-left-color: var(--tb-accent);
	background: color-mix(in srgb, var(--tb-accent) 8%, transparent);
	color: inherit;
}

.toolbox-app__status.is-error {
	border-left-color: #b32d2e;
	background: color-mix(in srgb, #b32d2e 10%, transparent);
}

.toolbox-app__status.is-loading {
	border-left-color: #dba617;
	background: color-mix(in srgb, #dba617 12%, transparent);
}

.toolbox-app__card {
	overflow: hidden;
}

.toolbox-app__card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: color-mix(in srgb, currentColor 4%, transparent);
	border-bottom: 1px solid var(--tb-line);
	color: inherit;
}

.toolbox-app__card-header h3 {
	margin: 0;
	font-size: 1.05em;
	font-weight: 700;
	color: inherit;
}

.toolbox-app__card-meta {
	opacity: 0.7;
	font-size: 0.85em;
}

.toolbox-app__card table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-size: 0.92em;
}

.toolbox-app__card th,
.toolbox-app__card td {
	text-align: left;
	padding: 0.65rem 0.85rem;
	border-top: 1px solid var(--tb-line);
	vertical-align: top;
	color: inherit;
}

.toolbox-app__card th {
	background: color-mix(in srgb, currentColor 4%, transparent);
	font-weight: 600;
}

.toolbox-app__card td.mono {
	font-family: inherit;
	word-break: break-word;
	white-space: pre-wrap;
}

.toolbox-app__card td.is-ok {
	color: #007017;
	font-weight: 600;
}

.toolbox-app__card td.is-bad {
	color: #b32d2e;
	font-weight: 600;
}

.toolbox-app__card td.is-warn {
	color: #9a6700;
	font-weight: 600;
}

.toolbox-app__notes,
.toolbox-app__recs {
	margin: 0;
	padding: 0.85rem 1rem 0.85rem 1.75rem;
	border-top: 1px solid var(--tb-line);
	background: color-mix(in srgb, var(--tb-accent) 6%, transparent);
}

.toolbox-app__empty {
	padding: 1rem;
	opacity: 0.75;
}

.toolbox-app--admin {
	margin-top: 8px;
}

.toolbox-admin-wrap {
	max-width: none;
	margin-right: 20px;
}

.wrap:has(.toolbox-app--admin) {
	max-width: none;
	margin-right: 20px;
}

/* Admin: WP-Admin-Theme-Farbe nutzen */
.toolbox-app--admin {
	--tb-accent: var(--wp-admin-theme-color, #2271b1);
	--tb-line: #c3c4c7;
	--tb-accent-contrast: #fff;
}

.toolbox-app--admin .toolbox-app__toolbtn,
.toolbox-app--admin .toolbox-app__host,
.toolbox-app--admin .toolbox-app__extra,
.toolbox-app--admin .toolbox-app__host-bulk,
.toolbox-app--admin .toolbox-app__fav,
.toolbox-app--admin .toolbox-app__history-item {
	background: #fff;
}

.toolbox-app__favorites {
	margin-bottom: 0.85rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--tb-line);
}

.toolbox-app__sidebar-subhead {
	margin-bottom: 0.45rem;
	font-size: 0.9em;
}

.toolbox-app__toolcell {
	display: flex;
	gap: 0.25rem;
	align-items: stretch;
	min-width: 0;
	max-width: none;
	width: 100%;
}

.toolbox-app__toolcell .toolbox-app__toolbtn {
	flex: 1 1 auto;
}

.toolbox-app__fav {
	appearance: none;
	flex: 0 0 1.7rem;
	width: 1.7rem;
	border: 1px solid var(--tb-line);
	border-radius: var(--tb-radius);
	background: transparent;
	color: inherit;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	opacity: 0.85;
}

.toolbox-app__fav.is-on,
.toolbox-app__fav:hover {
	opacity: 1;
	border-color: var(--tb-accent);
	background: color-mix(in srgb, var(--tb-accent) 12%, transparent);
}

.toolbox-app__export {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.toolbox-app__export button {
	appearance: none;
	border: 1px solid var(--tb-line);
	background: transparent;
	border-radius: var(--tb-radius);
	padding: 0.4rem 0.75rem;
	cursor: pointer;
}

.toolbox-app__score {
	display: inline-block;
	margin-top: 0.35rem;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-size: 0.8em;
	font-weight: 700;
}

.toolbox-app__score--green {
	background: color-mix(in srgb, #007017 18%, transparent);
	color: #007017;
}

.toolbox-app__score--yellow {
	background: color-mix(in srgb, #9a6700 18%, transparent);
	color: #9a6700;
}

.toolbox-app__score--red {
	background: color-mix(in srgb, #b32d2e 18%, transparent);
	color: #b32d2e;
}

.toolbox-app__bimi img {
	max-height: 48px;
	max-width: 120px;
	display: block;
	margin-bottom: 0.35rem;
}

.toolbox-app__history {
	padding: 0.85rem 1rem;
}

.toolbox-app__history-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.65rem;
}

.toolbox-app__history-list {
	display: grid;
	gap: 0.4rem;
}

.toolbox-app__history-item {
	appearance: none;
	width: 100%;
	text-align: left;
	border: 1px solid var(--tb-line);
	background: transparent;
	border-radius: var(--tb-radius);
	padding: 0.55rem 0.7rem;
	cursor: pointer;
	display: grid;
	gap: 0.15rem;
}

.toolbox-app__history-item span,
.toolbox-app__history-item em {
	font-size: 0.82em;
	opacity: 0.75;
	font-style: normal;
	font-family: inherit;
}

.toolbox-ampel {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	font-family: inherit;
}

.toolbox-ampel--grün,
.toolbox-ampel--green {
	background: color-mix(in srgb, #007017 18%, transparent);
	color: #007017;
}

.toolbox-ampel--gelb,
.toolbox-ampel--yellow {
	background: color-mix(in srgb, #9a6700 18%, transparent);
	color: #9a6700;
}

.toolbox-ampel--rot,
.toolbox-ampel--red {
	background: color-mix(in srgb, #b32d2e 18%, transparent);
	color: #b32d2e;
}

.toolbox-ampel--grau {
	background: color-mix(in srgb, currentColor 12%, transparent);
	color: inherit;
	opacity: 0.8;
}

@media (max-width: 1100px) {
	.toolbox-app__layout {
		grid-template-columns: 1fr;
	}

	.toolbox-app__grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

@media (max-width: 640px) {
	.toolbox-app__grid {
		grid-template-columns: 1fr;
	}

	.toolbox-app__toolcell {
		max-width: none;
		width: 100%;
	}

	.toolbox-app__host,
	.toolbox-app__extra,
	.toolbox-app__submit,
	.toolbox-app__host-bulk {
		width: 100%;
	}

	.toolbox-app__card-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

.toolbox-admin-wrap .nav-tab-wrapper,
.toolbox-settings-wrap .nav-tab-wrapper {
	margin: 12px 0 16px;
}
