/**
 * System/light/dark controls and variable-driven public surface adaptation.
 */

.tw-theme-mode {
	color: var(--tw-text);
}

.tw-theme-mode--desktop {
	position: fixed;
	z-index: 880;
	top: 50%;
	left: max(12px, env(safe-area-inset-left));
	display: none;
	transform: translateY(-50%);
}

.tw-theme-mode__toggle {
	display: grid;
	width: 50px;
	height: 50px;
	place-items: center;
	padding: 0;
	border: 1px solid var(--tw-border);
	border-radius: 16px;
	background: var(--tw-surface-raised);
	box-shadow: var(--tw-shadow);
	color: var(--tw-heading);
	cursor: pointer;
}

.tw-theme-mode__toggle:hover,
.tw-theme-mode__toggle:active {
	border-color: var(--tw-accent);
	background: var(--tw-surface-hover);
	color: var(--tw-accent);
}

.tw-theme-mode__current-icon {
	display: none;
	place-items: center;
}

html:not([data-tw-theme-preference]) .tw-theme-mode__current-icon--system,
html[data-tw-theme-preference="system"] .tw-theme-mode__current-icon--system,
html[data-tw-theme-preference="light"] .tw-theme-mode__current-icon--light,
html[data-tw-theme-preference="dark"] .tw-theme-mode__current-icon--dark {
	display: grid;
}

.tw-theme-mode__title {
	margin: 0 0 6px;
	color: var(--tw-text-muted);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.tw-theme-mode__options {
	display: grid;
	gap: 4px;
}

.tw-theme-mode__option {
	display: grid;
	min-width: 0;
	min-height: 44px;
	align-items: center;
	grid-template-columns: 24px minmax(0, 1fr) 22px;
	gap: 8px;
	padding: 7px 9px;
	border: 1px solid transparent;
	border-radius: 13px;
	background: transparent;
	color: var(--tw-text);
	font: inherit;
	font-size: 0.86rem;
	font-weight: 750;
	text-align: left;
	cursor: pointer;
}

.tw-theme-mode__option:hover {
	background: var(--tw-surface-hover);
}

.tw-theme-mode__option.is-active {
	border-color: color-mix(in srgb, var(--tw-accent) 38%, var(--tw-border));
	background: color-mix(in srgb, var(--tw-accent) 11%, var(--tw-surface-raised));
	color: var(--tw-accent-hover);
}

.tw-theme-mode__option-icon,
.tw-theme-mode__check {
	display: grid;
	place-items: center;
}

.tw-theme-mode__check {
	opacity: 0;
}

.tw-theme-mode__option.is-active .tw-theme-mode__check {
	opacity: 1;
}

.tw-theme-mode__toggle:focus-visible,
.tw-theme-mode__option:focus-visible {
	outline: 3px solid var(--tw-focus-color);
	outline-offset: 3px;
}

.tw-theme-mode--drawer {
	padding: 0.75rem 1rem;
	border-top: 1px solid var(--tw-drawer-border);
	color: var(--tw-drawer-text);
}

.tw-theme-mode--drawer .tw-theme-mode__panel {
	padding: 0;
}

.tw-theme-mode--drawer .tw-theme-mode__title {
	color: var(--tw-drawer-muted);
}

.tw-theme-mode--drawer .tw-theme-mode__options {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

.tw-theme-mode--drawer .tw-theme-mode__option {
	grid-template-columns: 20px minmax(0, 1fr);
	gap: 5px;
	padding-inline: 7px;
	border-color: var(--tw-drawer-border);
	background: var(--tw-drawer-surface);
	color: var(--tw-drawer-text);
	font-size: 0.76rem;
}

.tw-theme-mode--drawer .tw-theme-mode__option:hover {
	background: var(--tw-drawer-hover);
}

.tw-theme-mode--drawer .tw-theme-mode__option.is-active {
	border-color: var(--tw-accent);
	background: color-mix(in srgb, var(--tw-accent) 12%, var(--tw-drawer-surface));
	color: var(--tw-drawer-text);
}

.tw-theme-mode--drawer .tw-theme-mode__check {
	display: none;
}

html[data-tw-theme-preference="system"][data-tw-theme="light"] .tw-mobile-drawer {
	--tw-drawer-bg: #f4f5f6;
	--tw-drawer-surface: #ffffff;
	--tw-drawer-text: #17181a;
	--tw-drawer-muted: #6c7179;
	--tw-drawer-border: #dedfe2;
	--tw-drawer-hover: #ffffff;
}

html[data-tw-theme-preference="system"][data-tw-theme="dark"] .tw-mobile-drawer {
	--tw-drawer-bg: var(--tw-dark-bg-soft);
	--tw-drawer-surface: var(--tw-dark-surface-raised);
	--tw-drawer-text: var(--tw-dark-text);
	--tw-drawer-muted: var(--tw-dark-text-muted);
	--tw-drawer-border: var(--tw-dark-border);
	--tw-drawer-hover: var(--tw-dark-surface-hover);
}

@media (min-width: 1440px) {
	.tw-theme-mode--desktop {
		display: block;
	}

	.tw-theme-mode--drawer {
		display: none;
	}
}

@media (max-width: 390px) {
	.tw-theme-mode--drawer .tw-theme-mode__options {
		grid-template-columns: minmax(0, 1fr);
	}

	.tw-theme-mode--drawer .tw-theme-mode__option {
		grid-template-columns: 24px minmax(0, 1fr) 22px;
		font-size: 0.84rem;
	}

	.tw-theme-mode--drawer .tw-theme-mode__check {
		display: grid;
	}
}

/* Global WordPress surfaces. */
body,
.tw-site-main {
	background: var(--tw-bg);
	color: var(--tw-text);
}

:where(h1, h2, h3, h4, h5, h6),
.tw-entry-title,
.tw-page-header {
	color: var(--tw-heading);
}

.tw-entry + .tw-entry,
.tw-post-list .tw-entry,
.tw-empty-state,
.page-numbers,
table,
th,
td,
.wp-block-table table {
	border-color: var(--tw-border);
}

.tw-entry + .tw-entry,
.tw-post-list .tw-entry,
.page-numbers {
	background: var(--tw-surface);
}

.tw-empty-state {
	background: var(--tw-bg-soft);
}

.page-numbers.current {
	border-color: var(--tw-heading);
	background: var(--tw-heading);
	color: var(--tw-bg);
}

table,
.wp-block-table table {
	background: var(--tw-surface);
	color: var(--tw-text);
}

th {
	background: var(--tw-bg-soft);
	color: var(--tw-heading);
}

/* Home module: retain photographic and branded dark/red sections. */
.tw-home {
	--tw-home-muted: var(--tw-text-muted);
	--tw-home-line: var(--tw-border);
	--tw-home-soft: var(--tw-bg-soft);
	background: var(--tw-bg);
	color: var(--tw-text);
}

.tw-home :where(h2, h3):not(.tw-home-hero *, .tw-home-trust *, .tw-home-services *, .tw-home-equipment *, .tw-home-benefits *, .tw-home-process *, .tw-home-payments *, .tw-home-final *, .tw-home-configurator *, .tw-home-roboflow *) {
	color: var(--tw-heading);
}

.tw-home-section:nth-of-type(even) {
	background: var(--tw-bg-soft);
}

.tw-home-card,
.tw-home-feature,
.tw-home-check-grid li,
.tw-home-section:not(.tw-home-hero, .tw-home-trust, .tw-home-process, .tw-home-payments, .tw-home-final, .tw-home-configurator, .tw-home-roboflow) .tw-home-chip-list li,
.tw-home-direction-strip li {
	border-color: var(--tw-border);
	background: var(--tw-surface);
	color: var(--tw-text);
	box-shadow: var(--tw-shadow);
}

.tw-home-model-card__price {
	color: var(--tw-heading) !important;
}

.tw-home :where(
	.tw-home-hero,
	.tw-home-trust,
	.tw-home-services,
	.tw-home-configurator,
	.tw-home-equipment,
	.tw-home-benefits,
	.tw-home-process,
	.tw-home-payments,
	.tw-home-roboflow,
	.tw-home-final
) :where(h1, h2, h3, h4, h5, h6) {
	color: var(--tw-heading-on-dark);
}

.tw-home :where(.tw-home-services, .tw-home-benefits) .tw-home-feature {
	border-color: var(--tw-home-dark-line);
	background: rgba(255, 255, 255, 0.025);
	color: var(--tw-text-on-dark);
	box-shadow: none;
}

.tw-home :where(
	.tw-home-hero,
	.tw-home-trust,
	.tw-home-services,
	.tw-home-configurator,
	.tw-home-equipment,
	.tw-home-benefits,
	.tw-home-process,
	.tw-home-payments,
	.tw-home-roboflow,
	.tw-home-final
) {
	color: var(--tw-text-on-dark);
}

.tw-home :where(
	.tw-home-trust,
	.tw-home-configurator,
	.tw-home-equipment,
	.tw-home-process,
	.tw-home-payments,
	.tw-home-roboflow
) .tw-home-eyebrow,
.tw-home :where(.tw-home-equipment, .tw-home-roboflow) .tw-home-link {
	color: var(--tw-accent-on-dark) !important;
}

.tw-home :where(.tw-home-equipment, .tw-home-roboflow) .tw-home-button--outline {
	border-color: var(--tw-accent-on-dark);
	color: var(--tw-accent-on-dark) !important;
}

.tw-home :where(.tw-home-projects, .tw-home-demo) .tw-home-link,
.tw-home :where(.tw-home-projects, .tw-home-demo) .tw-home-button--outline {
	color: var(--tw-link) !important;
}

/* The photographic Home hero must not inherit the global light-theme heading color. */
.tw-home-hero h1 {
	color: #fff;
}

@media (max-width: 767px) {
	.tw-home-hero h1 {
		font-size: clamp(2.25rem, 8vw, 3.4rem);
		line-height: 1.02;
	}
}

/* Models module. */
.tw-models-archive,
.tw-model-single,
.tw-model-compare {
	--tw-model-ink: var(--tw-text);
	--tw-model-muted: var(--tw-text-muted);
	--tw-model-line: var(--tw-border);
	--tw-model-soft: var(--tw-bg-soft);
	color: var(--tw-text);
}

.tw-model-card,
.tw-model-feature,
.tw-model-metrics div,
.tw-model-list-cards article,
.tw-model-compare-selector,
.tw-model-compare-selector__choices label,
.tw-model-compare__desktop,
.tw-model-compare__head,
.tw-model-compare__mobile article,
.tw-model-projects article,
.tw-model-documents a {
	border-color: var(--tw-border);
	background: var(--tw-surface);
	color: var(--tw-text);
}

.tw-model-card,
.tw-model-feature,
.tw-model-metrics div,
.tw-model-list-cards article {
	box-shadow: var(--tw-shadow);
}

.tw-model-specs [role="rowheader"],
.tw-model-compare__row > strong,
.tw-model-empty {
	background: var(--tw-bg-soft);
}

.tw-model-price__gross strong,
.tw-model-card h2,
.tw-model-hero h1,
.tw-model-compare__header h1,
.tw-model-list-cards h3 {
	color: var(--tw-heading);
}

.tw-model-list-cards p {
	color: var(--tw-text-muted);
}

.tw-model-eyebrow,
.tw-model-button--secondary,
.tw-model-price__request,
.tw-model-feature__status {
	color: var(--tw-link) !important;
}

.tw-model-button--secondary {
	border-color: var(--tw-link);
}

/* Protect primary Core controls from transparent Elementor button defaults. */
.tw-model-button:not(.tw-model-button--secondary),
.tw-equipment-button:not(.tw-equipment-button--secondary) {
	border-color: var(--tw-accent);
	background: var(--tw-accent);
	color: var(--tw-accent-text) !important;
}

.tw-model-button:not(.tw-model-button--secondary):hover,
.tw-model-button:not(.tw-model-button--secondary):focus-visible,
.tw-equipment-button:not(.tw-equipment-button--secondary):hover,
.tw-equipment-button:not(.tw-equipment-button--secondary):focus-visible {
	border-color: var(--tw-accent-hover);
	background: var(--tw-accent-hover);
	color: var(--tw-accent-text) !important;
}

.tw-model-compare-toolbar,
.tw-model-final-cta {
	background: var(--tw-header-bg);
	color: var(--tw-header-text);
}

.tw-model-final-cta :where(h1, h2, h3, h4, h5, h6) {
	color: var(--tw-heading-on-dark);
}

.tw-model-final-cta .tw-model-button--secondary {
	border-color: var(--tw-accent-on-dark);
	color: var(--tw-accent-on-dark) !important;
}

.tw-model-compare__row--different > span {
	background: color-mix(in srgb, var(--tw-warning) 14%, var(--tw-surface));
}

/* Equipment module. */
.tw-equipment-archive,
.tw-equipment-single {
	--tw-equipment-ink: var(--tw-text);
	--tw-equipment-muted: var(--tw-text-muted);
	--tw-equipment-line: var(--tw-border);
	--tw-equipment-soft: var(--tw-bg-soft);
	color: var(--tw-text);
}

.tw-equipment-card,
.tw-equipment-filters,
.tw-equipment-documents a,
.tw-equipment-contact,
.tw-equipment-empty {
	border-color: var(--tw-border);
	background: var(--tw-surface);
	color: var(--tw-text);
}

.tw-equipment-card {
	box-shadow: var(--tw-shadow);
}

.tw-equipment-filter input[type="search"],
.tw-equipment-filter select {
	border-color: var(--tw-input-border);
	background: var(--tw-input-bg);
	color: var(--tw-input-text);
}

.tw-equipment-specifications__table [role="rowheader"],
.tw-equipment-card__media,
.tw-equipment-gallery__main {
	background: var(--tw-bg-soft);
}

.tw-equipment-pagination .current {
	background: var(--tw-header-bg);
	color: var(--tw-header-text);
}

.tw-equipment-card__category,
.tw-equipment-hero__category,
.tw-equipment-card__link,
.tw-equipment-price__request {
	color: var(--tw-link);
}

.tw-equipment-button--secondary {
	border-color: var(--tw-link);
	color: var(--tw-link) !important;
}

/* The archive landing is permanently dark, independently of the selected mode. */
.tw-equipment-landing {
	color: var(--tw-text-on-dark);
}

.tw-equipment-landing :where(h1, h2, h3, h4, h5, h6),
.tw-equipment-landing-roboflow__models h3 a {
	color: var(--tw-heading-on-dark);
}

.tw-equipment-landing :where(.tw-equipment-landing__eyebrow, .tw-equipment-landing-card__link) {
	color: var(--tw-accent-on-dark);
}

/* Projects module. */
.tw-projects-archive,
.tw-project-single {
	background: var(--tw-bg);
	color: var(--tw-text);
}

.tw-project-card,
.tw-projects-filters,
.tw-project-section,
.tw-project-spec,
.tw-project-story,
.tw-project-gallery-item,
.tw-projects-empty,
.tw-projects-error {
	border-color: var(--tw-border);
	background: var(--tw-surface);
	color: var(--tw-text);
	box-shadow: var(--tw-shadow);
}

.tw-project-card-title,
.tw-project-single-title,
.tw-project-section-title,
.tw-projects-archive-title {
	color: var(--tw-heading);
}

.tw-project-card-title a {
	color: var(--tw-heading);
}

.tw-project-card-summary,
.tw-project-card-details,
.tw-project-breadcrumbs,
.tw-project-hero-meta {
	color: var(--tw-text-muted);
}

.tw-project-breadcrumbs a {
	color: var(--tw-link);
}

.tw-project-card-details div,
.tw-project-facts div {
	border-color: var(--tw-border);
	color: var(--tw-text);
}

.tw-project-card-details dt,
.tw-project-facts dt {
	color: var(--tw-text-muted);
}

.tw-project-hero .tw-project-facts :where(dt, dd) {
	color: var(--tw-text-muted-on-dark);
}

.tw-projects-filter :where(input, select),
.tw-projects-reset {
	border-color: var(--tw-input-border);
	background: var(--tw-input-bg);
	color: var(--tw-input-text);
}

.tw-projects-pagination .page-numbers {
	border-color: var(--tw-border);
	background: var(--tw-surface-raised);
	color: var(--tw-text);
	box-shadow: var(--tw-shadow);
}

.tw-projects-pagination .page-numbers:hover,
.tw-projects-pagination .page-numbers:focus-visible {
	background: var(--tw-surface-hover);
	color: var(--tw-heading);
}

.tw-projects-pagination .page-numbers.current {
	border-color: var(--tw-accent);
	background: var(--tw-accent);
	color: var(--tw-accent-text);
}

.tw-projects-results[aria-busy="true"]::after {
	background: color-mix(in srgb, var(--tw-bg) 90%, transparent);
	color: var(--tw-text);
}

.tw-projects-archive .tw-project-button:not(.tw-project-button--secondary) {
	border-color: var(--tw-accent);
	background: var(--tw-accent);
	color: var(--tw-accent-text);
}

.tw-projects-archive .tw-project-button:not(.tw-project-button--secondary):where(:hover, :focus-visible, :active) {
	border-color: var(--tw-accent-hover);
	background: var(--tw-accent-hover);
	color: var(--tw-accent-text);
}

/* Configurator keeps its own layout while consuming the shared contrast tokens. */
.twc-configurator :where(
	.twc-eyebrow,
	.twc-card__price,
	.twc-card__placeholder,
	.twc-button--link,
	.twc-choice-row input:checked + span
) {
	color: var(--tw-link);
}

.twc-configurator .twc-button--primary {
	background: var(--tw-accent);
	color: var(--tw-accent-text);
}

.twc-configurator .twc-button--primary:where(:hover, :focus-visible, :active) {
	background: var(--tw-accent-hover);
	color: var(--tw-accent-text);
}

.twc-configurator .twc-summary__toggle {
	background: var(--tw-header-bg);
	color: var(--tw-header-text);
}

/*
 * Equipment pages must follow the resolved theme, including when the saved
 * preference is "system". The core catalogue previously keyed these tokens
 * only to the explicit light/dark buttons, which left white cards in a
 * system-resolved dark theme.
 */
html[data-tw-theme="light"] :is(.tw-equipment-archive, .tw-equipment-single) {
	--tw-equipment-bg: #fff;
	--tw-equipment-surface: #fff;
	--tw-equipment-surface-soft: #f5f7f8;
	--tw-equipment-text: #182127;
	--tw-equipment-text-muted: #5e6b73;
	--tw-equipment-border: #d7dfe3;
	--tw-equipment-ink: var(--tw-equipment-text);
	--tw-equipment-muted: var(--tw-equipment-text-muted);
	--tw-equipment-line: var(--tw-equipment-border);
	--tw-equipment-soft: var(--tw-equipment-surface-soft);
}

html[data-tw-theme="dark"] :is(.tw-equipment-archive, .tw-equipment-single) {
	--tw-equipment-bg: #11171b;
	--tw-equipment-surface: #1b242a;
	--tw-equipment-surface-soft: #222d34;
	--tw-equipment-text: #f3f6f7;
	--tw-equipment-text-muted: #b6c0c6;
	--tw-equipment-border: #36434b;
	--tw-equipment-ink: var(--tw-equipment-text);
	--tw-equipment-muted: var(--tw-equipment-text-muted);
	--tw-equipment-line: var(--tw-equipment-border);
	--tw-equipment-soft: var(--tw-equipment-surface-soft);
}

/* Elementor contact forms must remain readable on the page surface in both modes. */
html body.elementor-page .elementor-form .elementor-field-textual {
	border-color: var(--tw-input-border) !important;
	background-color: var(--tw-input-bg) !important;
	color: var(--tw-input-text) !important;
}

html body.elementor-page .elementor-form .elementor-field-textual::placeholder {
	color: var(--tw-input-placeholder) !important;
	opacity: 1;
}

html body.elementor-page .elementor-form .elementor-field-textual:where(:hover, :focus) {
	border-color: var(--tw-input-focus) !important;
}

/* Legacy Elementor headings on transparent sections must follow the dark page surface. */
html[data-tw-theme="dark"] .elementor-page .elementor-widget-heading .elementor-heading-title {
	color: var(--tw-heading);
}

@media (prefers-color-scheme: dark) {
	html:not([data-tw-theme]) .elementor-page .elementor-widget-heading .elementor-heading-title {
		color: var(--tw-heading);
	}
}

/* Drawer uses the appropriate existing light/dark logo assets. */
@media (prefers-color-scheme: dark) {
	html:not([data-tw-theme]) .tw-mobile-drawer-brand__scheme--light {
		display: none;
	}

	html:not([data-tw-theme]) .tw-mobile-drawer-brand__scheme--dark {
		display: inline-flex;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tw-theme-mode *,
	.tw-theme-mode *::before,
	.tw-theme-mode *::after {
		transition: none !important;
	}
}
