/**
 * Tehnika Media Exporter & Cleaner — admin styles.
 *
 * Built on WordPress' own admin variables so the interface follows the user's
 * chosen admin colour scheme instead of hard-coding a palette.
 *
 * @package Tehnika_Media_Exporter
 */

.tme-app {
	--tme-accent: var(--wp-admin-theme-color, #2271b1);
	--tme-accent-dark: var(--wp-admin-theme-color-darker-10, #135e96);
	--tme-accent-soft: rgba(34, 113, 177, 0.08);

	--tme-surface: #fff;
	--tme-surface-alt: #f6f7f7;
	--tme-border: #dcdcde;
	--tme-border-strong: #c3c4c7;

	--tme-text: #1d2327;
	--tme-text-mute: #646970;

	--tme-ok: #00733f;
	--tme-warn: #8a5b00;
	--tme-danger: #b32d2e;

	--tme-radius: 6px;
	--tme-radius-lg: 10px;
	--tme-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	--tme-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.18);

	--tme-gap: 20px;

	color: var(--tme-text);
	max-width: 1400px;
}

/* ---------------------------------------------------------------- header -- */

.tme-header {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	margin: 8px 0 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--tme-border);
}

.tme-brand {
	display: flex;
	gap: 14px;
	align-items: center;
}

.tme-brand-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--tme-radius-lg);
	background: var(--tme-accent);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	flex-shrink: 0;
}

.tme-brand-text h1 {
	margin: 0;
	padding: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
}

.tme-brand-text p {
	margin: 2px 0 0;
	color: var(--tme-text-mute);
	font-size: 13px;
}

.tme-header-meta {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.tme-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px 3px 7px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid transparent;
}

.tme-pill .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

.tme-pill-ok {
	background: #edfaef;
	color: var(--tme-ok);
	border-color: #b8e6c4;
}

.tme-pill-warn {
	background: #fdf6e3;
	color: var(--tme-warn);
	border-color: #f0dca8;
}

.tme-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	text-decoration: none;
	color: var(--tme-accent);
}

.tme-link:hover,
.tme-link:focus {
	color: var(--tme-accent-dark);
}

.tme-link .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* ------------------------------------------------------------------ tabs -- */

.tme-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0 0 20px;
	padding: 4px;
	background: var(--tme-surface-alt);
	border: 1px solid var(--tme-border);
	border-radius: var(--tme-radius-lg);
}

.tme-tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 16px;
	border: 0;
	border-radius: var(--tme-radius);
	background: transparent;
	color: var(--tme-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	line-height: 1.2;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.tme-tab .dashicons {
	font-size: 17px;
	width: 17px;
	height: 17px;
	opacity: 0.75;
}

.tme-tab:hover {
	background: rgba(0, 0, 0, 0.045);
}

.tme-tab[aria-selected="true"] {
	background: var(--tme-surface);
	color: var(--tme-accent);
	box-shadow: var(--tme-shadow);
	font-weight: 600;
}

.tme-tab[aria-selected="true"] .dashicons {
	opacity: 1;
}

.tme-panel:focus {
	outline: none;
}

.tme-panel:focus-visible {
	outline: 2px solid var(--tme-accent);
	outline-offset: 3px;
	border-radius: var(--tme-radius);
}

/* ---------------------------------------------------------------- layout -- */

.tme-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: var(--tme-gap);
	align-items: start;
}

.tme-layout-main,
.tme-stack {
	display: flex;
	flex-direction: column;
	gap: var(--tme-gap);
	min-width: 0;
}

.tme-layout-side {
	position: sticky;
	top: 46px;
	min-width: 0;
}

@media (max-width: 1200px) {
	.tme-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.tme-layout-side {
		position: static;
	}
}

/* ----------------------------------------------------------------- cards -- */

.tme-card {
	background: var(--tme-surface);
	border: 1px solid var(--tme-border);
	border-radius: var(--tme-radius-lg);
	box-shadow: var(--tme-shadow);
	padding: 20px;
	margin: 0;
	min-width: 0;
}

fieldset.tme-card {
	border: 1px solid var(--tme-border);
}

.tme-card-title,
.tme-card > legend {
	display: block;
	margin: 0 0 16px;
	padding: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--tme-text);
}

.tme-subcard {
	margin: 14px 0;
	padding: 14px;
	border: 1px solid var(--tme-border);
	border-radius: var(--tme-radius);
	background: var(--tme-surface-alt);
}

.tme-rule {
	border: 0;
	border-top: 1px solid var(--tme-border);
	margin: 18px 0;
}

.tme-hint,
.tme-note {
	margin: 8px 0 0;
	color: var(--tme-text-mute);
	font-size: 12px;
	line-height: 1.6;
}

.tme-note {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	padding: 10px 12px;
	background: var(--tme-accent-soft);
	border-radius: var(--tme-radius);
	color: var(--tme-text);
}

.tme-note .dashicons {
	font-size: 17px;
	width: 17px;
	height: 17px;
	color: var(--tme-accent);
	flex-shrink: 0;
}

/* --------------------------------------------------------------- fields -- */

.tme-field {
	margin: 0 0 20px;
}

.tme-field:last-child {
	margin-bottom: 0;
}

.tme-field-split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

@media (max-width: 782px) {
	.tme-field-split {
		grid-template-columns: minmax(0, 1fr);
	}
}

.tme-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
}

.tme-input,
.tme-select {
	width: 100%;
	max-width: 100%;
	border: 1px solid var(--tme-border-strong);
	border-radius: var(--tme-radius);
	padding: 6px 10px;
	min-height: 34px;
	background: var(--tme-surface);
	color: var(--tme-text);
	box-shadow: none;
	font-size: 13px;
}

.tme-input:focus,
.tme-select:focus {
	border-color: var(--tme-accent);
	box-shadow: 0 0 0 1px var(--tme-accent);
	outline: 2px solid transparent;
}

.tme-input-wide {
	width: 100%;
	margin-top: 6px;
}

.tme-check,
.tme-radio {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	cursor: pointer;
	line-height: 1.4;
}

.tme-check input,
.tme-radio input {
	margin: 0;
	flex-shrink: 0;
}

.tme-check-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 8px 16px;
}

.tme-check-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
}

.tme-check-inline {
	display: flex;
	margin-top: 12px;
}

.tme-count {
	font-style: normal;
	color: var(--tme-text-mute);
	font-size: 11px;
	margin-left: auto;
	padding-left: 8px;
}

.tme-check .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: var(--tme-text-mute);
}

.tme-radio-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
}

.tme-details {
	margin: 12px 0;
	padding: 10px 12px;
	border: 1px solid var(--tme-border);
	border-radius: var(--tme-radius);
	background: var(--tme-surface-alt);
}

.tme-details > summary {
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
}

.tme-details > summary:focus-visible {
	outline: 2px solid var(--tme-accent);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- modes -- */

.tme-mode-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.tme-mode {
	position: relative;
	display: block;
	border: 1px solid var(--tme-border-strong);
	border-radius: var(--tme-radius);
	padding: 14px;
	cursor: pointer;
	transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
	background: var(--tme-surface);
}

.tme-mode:hover {
	border-color: var(--tme-accent);
}

.tme-mode input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tme-mode input:focus-visible + .tme-mode-body {
	outline: 2px solid var(--tme-accent);
	outline-offset: 4px;
	border-radius: var(--tme-radius);
}

.tme-mode:has(input:checked) {
	border-color: var(--tme-accent);
	background: var(--tme-accent-soft);
	box-shadow: inset 0 0 0 1px var(--tme-accent);
}

.tme-mode-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.tme-mode-head .dashicons {
	color: var(--tme-accent);
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.tme-mode-desc {
	display: block;
	color: var(--tme-text-mute);
	font-size: 12px;
	line-height: 1.6;
}

/* -------------------------------------------------------------- pickers -- */

.tme-picker {
	position: relative;
}

.tme-picker-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.tme-picker-chips:empty {
	display: none;
}

.tme-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 6px 3px 10px;
	border-radius: 999px;
	border: 1px solid var(--tme-accent);
	background: var(--tme-accent-soft);
	color: var(--tme-accent-dark);
	font-size: 12px;
	line-height: 1.6;
	max-width: 100%;
}

.tme-chip > span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tme-chip-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
}

.tme-chip-remove:hover {
	background: var(--tme-accent);
	color: #fff;
}

.tme-chip-ghost {
	border-style: dashed;
	border-color: var(--tme-border-strong);
	background: transparent;
	color: var(--tme-text-mute);
	padding: 2px 9px;
	cursor: pointer;
}

.tme-chip-ghost:hover {
	border-color: var(--tme-accent);
	color: var(--tme-accent);
	background: var(--tme-accent-soft);
}

.tme-picker-suggest {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.tme-picker-results {
	position: absolute;
	z-index: 50;
	top: 100%;
	left: 0;
	right: 0;
	max-height: 240px;
	overflow-y: auto;
	margin: 4px 0 0;
	padding: 4px;
	list-style: none;
	background: var(--tme-surface);
	border: 1px solid var(--tme-border-strong);
	border-radius: var(--tme-radius);
	box-shadow: var(--tme-shadow-lg);
}

.tme-picker-results li {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
}

.tme-picker-results li[aria-selected="true"],
.tme-picker-results li:hover {
	background: var(--tme-accent-soft);
	color: var(--tme-accent-dark);
}

.tme-picker-results em {
	font-style: normal;
	color: var(--tme-text-mute);
	font-size: 11px;
}

.tme-picker-empty {
	cursor: default;
	color: var(--tme-text-mute);
}

/* ----------------------------------------------------------- date range -- */

.tme-daterange {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tme-daterange-sep {
	color: var(--tme-text-mute);
	font-size: 12px;
}

.tme-quickdates {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}

/* -------------------------------------------------------------- formats -- */

.tme-formats {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tme-format {
	position: relative;
	display: block;
	border: 1px solid var(--tme-border-strong);
	border-radius: var(--tme-radius);
	padding: 10px 12px;
	cursor: pointer;
	transition: border-color 0.12s ease, background-color 0.12s ease;
}

.tme-format:hover {
	border-color: var(--tme-accent);
}

.tme-format input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tme-format input:focus-visible + .tme-format-body {
	outline: 2px solid var(--tme-accent);
	outline-offset: 3px;
	border-radius: var(--tme-radius);
}

.tme-format:has(input:checked) {
	border-color: var(--tme-accent);
	background: var(--tme-accent-soft);
	box-shadow: inset 0 0 0 1px var(--tme-accent);
}

.tme-format.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.tme-format-body {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.tme-format-body > .dashicons {
	color: var(--tme-accent);
	font-size: 19px;
	width: 19px;
	height: 19px;
	margin-top: 1px;
	flex-shrink: 0;
}

.tme-format-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tme-format-text strong {
	font-size: 13px;
}

.tme-format-text small {
	color: var(--tme-text-mute);
	font-size: 11px;
	line-height: 1.5;
}

.tme-format-ext {
	margin-left: auto;
	align-self: center;
	font-size: 11px;
	color: var(--tme-text-mute);
	background: var(--tme-surface-alt);
	border-radius: 4px;
	padding: 1px 5px;
}

/* -------------------------------------------------------------- summary -- */

.tme-summary h3,
.tme-presets h3 {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tme-text-mute);
}

.tme-summary-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 12px;
	color: var(--tme-text-mute);
}

.tme-summary-chips span.tme-summary-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--tme-surface-alt);
	border: 1px solid var(--tme-border);
}

.tme-preview {
	margin-top: 14px;
	padding: 14px;
	border-radius: var(--tme-radius);
	background: var(--tme-surface-alt);
	border: 1px solid var(--tme-border);
}

.tme-preview-numbers {
	display: flex;
	gap: 18px;
	align-items: baseline;
	margin-bottom: 10px;
}

.tme-preview-numbers strong {
	display: block;
	font-size: 20px;
	line-height: 1.1;
}

.tme-preview-numbers span {
	font-size: 11px;
	color: var(--tme-text-mute);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tme-preview-breakdown {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.tme-preview-sample {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 11px;
	color: var(--tme-text-mute);
}

.tme-preview-sample li {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* -------------------------------------------------------------- actions -- */

.tme-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

.tme-btn-block {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 36px;
}

.tme-btn-block .dashicons {
	font-size: 17px;
	width: 17px;
	height: 17px;
}

/* -------------------------------------------------------------- toolbar -- */

.tme-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--tme-surface);
	border: 1px solid var(--tme-border);
	border-radius: var(--tme-radius-lg);
	box-shadow: var(--tme-shadow);
}

.tme-toolbar-text {
	margin: 0;
	font-size: 12px;
	color: var(--tme-text-mute);
	max-width: 70ch;
}

/* ---------------------------------------------------------------- stats -- */

.tme-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--tme-gap);
}

.tme-stat {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 18px 20px;
	background: var(--tme-surface);
	border: 1px solid var(--tme-border);
	border-radius: var(--tme-radius-lg);
	box-shadow: var(--tme-shadow);
}

.tme-stat-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: var(--tme-radius);
	background: var(--tme-accent-soft);
	color: var(--tme-accent);
	font-size: 21px;
	flex-shrink: 0;
}

.tme-stat-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tme-text-mute);
}

.tme-stat-value {
	display: block;
	font-size: 22px;
	line-height: 1.3;
}

.tme-stat-note {
	display: block;
	font-size: 11px;
	color: var(--tme-warn);
}

.tme-charts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: var(--tme-gap);
}

.tme-donut {
	display: flex;
	justify-content: center;
	padding: 10px 0;
}

.tme-donut svg {
	max-width: 210px;
	height: auto;
}

.tme-legend {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 6px 16px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
}

.tme-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tme-legend .tme-swatch {
	width: 10px;
	height: 10px;
	border-radius: 3px;
	flex-shrink: 0;
}

.tme-legend strong {
	margin-left: auto;
}

.tme-bars {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 180px;
	padding-top: 10px;
}

.tme-bar {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
}

.tme-bar-fill {
	width: 100%;
	min-height: 2px;
	border-radius: 4px 4px 0 0;
	background: var(--tme-accent);
	transition: height 0.2s ease;
}

.tme-bar-value {
	font-size: 10px;
	color: var(--tme-text-mute);
	margin-bottom: 3px;
}

.tme-bar-label {
	margin-top: 6px;
	font-size: 10px;
	color: var(--tme-text-mute);
	white-space: nowrap;
}

.tme-rank {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
}

.tme-rank li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 0;
	border-bottom: 1px solid var(--tme-border);
}

.tme-rank li:last-child {
	border-bottom: 0;
}

.tme-rank .tme-rank-bar {
	height: 6px;
	border-radius: 3px;
	background: var(--tme-accent);
	min-width: 3px;
}

.tme-rank strong {
	margin-left: auto;
}

.tme-unused-result {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: var(--tme-radius);
	background: var(--tme-accent-soft);
	font-size: 13px;
}

.tme-unused-result strong {
	font-size: 20px;
}

/* ---------------------------------------------------------------- table -- */

.tme-table {
	border-collapse: collapse;
	background: var(--tme-surface);
}

.tme-table th {
	font-weight: 600;
}

.tme-table code {
	font-size: 11px;
}

.tme-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 48px 24px;
	text-align: center;
	background: var(--tme-surface);
	border: 1px dashed var(--tme-border-strong);
	border-radius: var(--tme-radius-lg);
	color: var(--tme-text-mute);
}

.tme-empty .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	opacity: 0.4;
}

.tme-empty p {
	margin: 0;
	max-width: 52ch;
	font-size: 13px;
}

.tme-empty-cell {
	padding: 24px;
	text-align: center;
	color: var(--tme-text-mute);
}

.tme-muted {
	color: var(--tme-text-mute);
	font-size: 11px;
}

.tme-ok {
	color: var(--tme-ok);
	font-weight: 600;
}

.tme-warn {
	color: var(--tme-warn);
	font-weight: 600;
}

.tme-badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	background: var(--tme-surface-alt);
	border: 1px solid var(--tme-border);
}

.tme-badge-done {
	background: #edfaef;
	border-color: #b8e6c4;
	color: var(--tme-ok);
}

.tme-badge-running {
	background: #eef6fd;
	border-color: #b7d9f5;
	color: var(--tme-accent-dark);
}

.tme-badge-error {
	background: #fdf0f0;
	border-color: #f0b8b8;
	color: var(--tme-danger);
}

.tme-badge-cancelled,
.tme-badge-pending {
	background: var(--tme-surface-alt);
	color: var(--tme-text-mute);
}

/* --------------------------------------------------------------- overlay -- */

.tme-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.55);
}

.tme-overlay[hidden] {
	display: none;
}

.tme-overlay-card {
	width: min(520px, 100%);
	padding: 28px;
	background: var(--tme-surface);
	border-radius: var(--tme-radius-lg);
	box-shadow: var(--tme-shadow-lg);
}

.tme-overlay-card h2 {
	margin: 0 0 6px;
	font-size: 18px;
}

.tme-overlay-status {
	margin: 0 0 18px;
	color: var(--tme-text-mute);
	font-size: 13px;
	min-height: 20px;
}

.tme-progress-track {
	height: 10px;
	border-radius: 999px;
	background: var(--tme-surface-alt);
	border: 1px solid var(--tme-border);
	overflow: hidden;
}

.tme-progress-fill {
	height: 100%;
	width: 0;
	background: var(--tme-accent);
	transition: width 0.2s ease;
}

.tme-progress-meta {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 12px;
	color: var(--tme-text-mute);
}

.tme-overlay-note {
	margin: 18px 0;
	padding: 10px 12px;
	border-radius: var(--tme-radius);
	background: var(--tme-surface-alt);
	font-size: 12px;
	color: var(--tme-text-mute);
	line-height: 1.6;
}

.tme-overlay-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

/* ---------------------------------------------------------------- toast -- */

.tme-toasts {
	position: fixed;
	left: 200px;
	right: auto;
	bottom: 24px;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	max-width: 380px;
}

@media (max-width: 782px) {
	.tme-toasts {
		left: 16px;
		right: 16px;
		max-width: none;
	}
}

.tme-toast {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 12px 14px;
	border-radius: var(--tme-radius);
	background: #1d2327;
	color: #fff;
	box-shadow: var(--tme-shadow-lg);
	font-size: 13px;
	line-height: 1.5;
	animation: tme-toast-in 0.18s ease-out;
}

.tme-toast .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 1px;
}

.tme-toast-success .dashicons {
	color: #6ce29a;
}

.tme-toast-error .dashicons {
	color: #ff9a9a;
}

.tme-toast-error {
	background: #5c1d1d;
}

@keyframes tme-toast-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* ----------------------------------------------------------------- help -- */

.tme-help {
	max-width: 900px;
}

.tme-steps,
.tme-list {
	margin: 0;
	padding-left: 20px;
	font-size: 13px;
	line-height: 1.8;
}

.tme-dl {
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
}

.tme-dl dt {
	font-weight: 600;
	margin-top: 12px;
}

.tme-dl dt:first-child {
	margin-top: 0;
}

.tme-dl dd {
	margin: 2px 0 0;
	color: var(--tme-text-mute);
}

.tme-code {
	overflow-x: auto;
	margin: 0;
	padding: 14px;
	border-radius: var(--tme-radius);
	background: #1d2327;
	color: #f0f0f1;
	font-size: 12px;
	line-height: 1.7;
}

.tme-code code {
	background: transparent;
	color: inherit;
	padding: 0;
}

.tme-help p {
	font-size: 13px;
	line-height: 1.7;
}

/* ------------------------------------------------------------ utilities -- */

.tme-app [hidden] {
	display: none !important;
}

.tme-app .button:focus-visible,
.tme-app .tme-tab:focus-visible,
.tme-app .tme-chip-ghost:focus-visible {
	outline: 2px solid var(--tme-accent);
	outline-offset: 2px;
	box-shadow: none;
}

.tme-app .is-busy {
	opacity: 0.6;
	pointer-events: none;
}

.tme-app .tme-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--tme-accent);
	border-radius: 50%;
	animation: tme-spin 0.7s linear infinite;
	vertical-align: -2px;
}

@keyframes tme-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tme-app *,
	.tme-overlay * {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* ---------------------------------------------------------------- cleaner -- */

.tme-clean-intro {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	border-left: 4px solid var(--tme-accent);
}

.tme-clean-intro > .dashicons {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	font-size: 28px;
	color: var(--tme-accent);
}

.tme-clean-intro .tme-card-title {
	margin-bottom: 6px;
}

.tme-clean-intro p {
	margin: 0;
	color: var(--tme-text-mute);
	font-size: 13px;
	line-height: 1.65;
	max-width: 82ch;
}

.tme-note-warn {
	background: #fdf6e3;
	color: #6b4a00;
}

.tme-note-warn .dashicons {
	color: var(--tme-warn);
}

.tme-actions-stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 8px;
}

.tme-action-card {
	position: relative;
	display: flex;
	gap: 11px;
	align-items: flex-start;
	padding: 12px;
	border: 1px solid var(--tme-border-strong);
	border-radius: var(--tme-radius);
	cursor: pointer;
	background: var(--tme-surface);
	transition: border-color 0.12s ease, background-color 0.12s ease;
}

.tme-action-card:hover {
	border-color: var(--tme-accent);
}

.tme-action-card input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tme-action-card:has(input:checked) {
	border-color: var(--tme-accent);
	background: var(--tme-accent-soft);
	box-shadow: inset 0 0 0 1px var(--tme-accent);
}

.tme-action-card.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.tme-action-icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	font-size: 22px;
	color: var(--tme-accent);
}

.tme-action-danger .tme-action-icon {
	color: var(--tme-danger);
}

.tme-action-danger:has(input:checked) {
	border-color: var(--tme-danger);
	background: #fdf0f0;
	box-shadow: inset 0 0 0 1px var(--tme-danger);
}

.tme-action-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	font-size: 13px;
	line-height: 1.45;
}

.tme-action-text small {
	color: var(--tme-text-mute);
	font-size: 11px;
	line-height: 1.55;
}

.tme-action-card .tme-badge {
	margin-left: auto;
	align-self: flex-start;
	flex-shrink: 0;
}

.tme-btn-danger,
.tme-btn-danger:focus {
	background: var(--tme-danger);
	border-color: var(--tme-danger);
	color: #fff;
	text-shadow: none;
	box-shadow: none;
}

.tme-btn-danger:hover,
.tme-btn-danger:focus:hover {
	background: #8a2424;
	border-color: #8a2424;
	color: #fff;
}

.tme-btn-danger:disabled,
.tme-btn-danger:disabled:hover {
	background: #dcdcde !important;
	border-color: #dcdcde !important;
	color: #a7aaad !important;
	cursor: not-allowed;
}

.tme-clean-result {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: var(--tme-radius);
	border: 1px solid #b8e6c4;
	background: #edfaef;
	font-size: 13px;
}

.tme-clean-result strong {
	font-size: 20px;
	line-height: 1;
	color: var(--tme-ok);
}

.tme-clean-result .button {
	margin-left: auto;
}

.tme-confirm-card {
	width: min(560px, 100%);
}

.tme-confirm-numbers {
	display: flex;
	gap: 28px;
	margin: 4px 0 14px;
}

.tme-confirm-numbers strong {
	display: block;
	font-size: 24px;
	line-height: 1.1;
}

.tme-confirm-numbers span {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--tme-text-mute);
}

.tme-confirm-breakdown {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.tme-confirm-sample {
	margin: 0 0 14px;
	padding: 10px 12px;
	list-style: none;
	border-radius: var(--tme-radius);
	background: var(--tme-surface-alt);
	border: 1px solid var(--tme-border);
	font-size: 11px;
	color: var(--tme-text-mute);
	max-height: 92px;
	overflow: hidden;
}

.tme-confirm-sample li {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tme-confirm-warning {
	margin: 0 0 14px;
	padding: 10px 12px;
	border-radius: var(--tme-radius);
	background: #fdf0f0;
	border: 1px solid #f0b8b8;
	color: #8a2424;
	font-size: 12px;
	line-height: 1.6;
}

.tme-confirm-ack {
	display: flex;
	margin-bottom: 14px;
}

.tme-confirm-type {
	display: block;
	margin-bottom: 16px;
}

.tme-confirm-card .tme-overlay-actions {
	justify-content: flex-end;
}

.tme-badge-export {
	background: #eef6fd;
	border-color: #b7d9f5;
	color: var(--tme-accent-dark);
}

.tme-badge-clean {
	background: #fdf6e3;
	border-color: #f0dca8;
	color: var(--tme-warn);
}

.tme-clean-status {
	min-height: 18px;
	margin: 10px 0 0;
	color: var(--tme-text-mute);
	font-size: 12px;
	line-height: 1.55;
}

.tme-clean-status:empty {
	display: none;
}

#tme-clean-script-warning,
#tme-clean-error {
	margin: 0;
}

#tme-clean-script-warning p,
#tme-clean-error p {
	margin: 0.5em 0;
}
