/* "Switch to RestroPress" importer screen. */
.rpi-wrap {
	--rpi-accent: #f39c12;
	--rpi-accent-dark: #8a5a00; /* 5.9:1 on white for the source meta text. */
	--rpi-border: #dcdcde;
	--rpi-muted: #646970;
	--rpi-warn-bg: #fcf9e8;
	--rpi-warn-border: #dba617;
	--rpi-error-bg: #fcf0f1;
	--rpi-error-border: #d63638;
	max-width: 1200px;
}

.rpi-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 20px;
	padding: 0;
	list-style: none;
	counter-reset: rpi-step;
}
.rpi-steps li {
	counter-increment: rpi-step;
	margin: 0;
	padding: 6px 12px 6px 8px;
	border: 1px solid var(--rpi-border);
	border-radius: 999px;
	background: #fff;
	color: var(--rpi-muted);
	font-size: 13px;
	line-height: 20px;
}
.rpi-steps li::before {
	content: counter(rpi-step);
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-inline-end: 6px;
	border-radius: 50%;
	background: #f0f0f1;
	color: #1d2327;
	font-weight: 600;
	text-align: center;
}
.rpi-steps li.is-active {
	border-color: var(--rpi-accent);
	color: #1d2327;
	font-weight: 600;
}
.rpi-steps li.is-active::before,
.rpi-steps li.is-done::before {
	background: var(--rpi-accent);
	color: #1d2327; /* 7.2:1 on the accent; white was 2.2:1. */
}

.rpi-panel {
	box-sizing: border-box;
	padding: 20px 24px;
	border: 1px solid var(--rpi-border);
	border-radius: 8px;
	background: #fff;
}
.rpi-panel[hidden],
.rpi-wrap [hidden] {
	display: none !important;
}
.rpi-panel h2 {
	margin: 0 0 12px;
	font-size: 18px;
}
.rpi-lead {
	margin: 0 0 16px;
	color: var(--rpi-muted);
}

.rpi-notice {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-inline-start: 4px solid var(--rpi-error-border);
	background: var(--rpi-error-bg);
}

.rpi-sources {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 12px;
}
.rpi-source {
	display: flex;
	flex-direction: column;
	gap: 6px;
	box-sizing: border-box;
	min-height: 120px;
	margin: 0;
	padding: 16px;
	border: 1px solid var(--rpi-border);
	border-radius: 8px;
	background: #fff;
	color: #1d2327;
	font: inherit;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.rpi-source:hover,
.rpi-source:focus {
	border-color: var(--rpi-accent);
	box-shadow: 0 0 0 1px var(--rpi-accent);
	color: #1d2327;
	outline: none;
}
.rpi-source.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
	box-shadow: none;
	border-color: var(--rpi-border);
}
.rpi-source--ai {
	border-style: dashed;
}
.rpi-source-title {
	font-size: 15px;
	font-weight: 600;
}
.rpi-source-desc {
	color: var(--rpi-muted);
	font-size: 13px;
	line-height: 1.5;
}
.rpi-source-meta {
	margin-top: auto;
	color: var(--rpi-accent-dark);
	font-size: 12px;
	font-weight: 600;
}

.rpi-recent-title {
	margin-top: 28px !important;
}
.rpi-recent td,
.rpi-recent th {
	vertical-align: middle;
}
.rpi-recent-actions .button-link {
	margin-inline-end: 12px;
}
.rpi-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: #f0f0f1;
	font-size: 12px;
}
.rpi-status--done {
	background: #edfaef;
	color: #00632a;
}
.rpi-status--undone {
	background: #f0f0f1;
	color: var(--rpi-muted);
}
.rpi-status--running,
.rpi-status--undoing {
	background: var(--rpi-warn-bg);
	color: #6b4f00;
}

.rpi-help {
	max-width: 820px;
	color: #1d2327;
}
.rpi-help ul {
	margin: 0 0 12px 18px;
	list-style: disc;
}
.rpi-file {
	margin: 16px 0;
}
.rpi-file label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}
.rpi-file input[type="file"] {
	box-sizing: border-box;
	max-width: 100%;
	padding: 10px;
	border: 1px dashed var(--rpi-border);
	border-radius: 6px;
	background: #f6f7f7;
}
.rpi-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0;
}

.rpi-counts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 16px;
}
.rpi-count {
	min-width: 110px;
	padding: 10px 14px;
	border: 1px solid var(--rpi-border);
	border-radius: 6px;
	background: #f6f7f7;
}
.rpi-count strong {
	display: block;
	font-size: 20px;
	line-height: 1.2;
}
.rpi-count span {
	color: var(--rpi-muted);
	font-size: 12px;
}
.rpi-count.is-warning {
	border-color: var(--rpi-warn-border);
	background: var(--rpi-warn-bg);
}

.rpi-warnings {
	margin: 0 0 16px;
	padding: 10px 14px 10px 30px;
	border-inline-start: 4px solid var(--rpi-warn-border);
	background: var(--rpi-warn-bg);
	list-style: disc;
}

.rpi-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 12px;
	margin: 0 0 16px;
}
.rpi-options fieldset {
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--rpi-border);
	border-radius: 6px;
}
.rpi-options legend {
	padding: 0 4px;
	font-weight: 600;
}
.rpi-options label {
	display: block;
	margin: 6px 0;
}
.rpi-options ul {
	margin: 4px 0 8px 18px;
	list-style: disc;
}

.rpi-map {
	margin: 0 0 16px;
}
.rpi-map summary,
.rpi-log summary {
	cursor: pointer;
	font-weight: 600;
}
.rpi-map table {
	margin-top: 8px;
}
.rpi-map th {
	width: 35%;
	font-family: Menlo, Consolas, monospace;
	font-size: 12px;
}

.rpi-table-wrap {
	max-height: 560px;
	overflow: auto;
	border: 1px solid var(--rpi-border);
	border-radius: 6px;
}
.rpi-preview {
	border: 0;
}
.rpi-preview thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #f6f7f7;
}
.rpi-preview td {
	vertical-align: top;
}
.rpi-preview tr.has-warning td {
	background: var(--rpi-warn-bg);
}
.rpi-preview tr.is-skip td {
	color: var(--rpi-muted);
}
.rpi-row-warnings {
	margin: 0;
	padding-inline-start: 16px;
	color: #6b4f00;
	list-style: disc;
	font-size: 12px;
}
.rpi-muted {
	color: var(--rpi-muted);
}
.rpi-action {
	white-space: nowrap;
}

.rpi-progress {
	height: 12px;
	overflow: hidden;
	border-radius: 999px;
	background: #f0f0f1;
}
.rpi-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--rpi-accent);
	transition: width 0.3s;
}

.rpi-log ul {
	max-height: 320px;
	margin: 8px 0 0;
	overflow: auto;
	padding-inline-start: 18px;
	list-style: disc;
	font-size: 13px;
}
.rpi-log-warning {
	color: #6b4f00;
}
.rpi-log-error {
	color: var(--rpi-error-border);
}

@media (max-width: 782px) {
	.rpi-panel {
		padding: 16px;
	}
	.rpi-preview th:nth-child(5),
	.rpi-preview td:nth-child(5),
	.rpi-preview th:nth-child(6),
	.rpi-preview td:nth-child(6) {
		display: none;
	}
}

/* RTL: mirror the asymmetric boxes above. */
[dir="rtl"] .rpi-steps li {
	padding: 6px 8px 6px 12px;
}
[dir="rtl"] .rpi-help ul {
	margin: 0 18px 12px 0;
}
[dir="rtl"] .rpi-warnings {
	padding: 10px 30px 10px 14px;
}
[dir="rtl"] .rpi-options ul {
	margin: 4px 18px 8px 0;
}

/* Keyboard focus: a ring distinct from the hover border. */
.rpi-source:focus-visible {
	outline: 2px solid var(--rpi-accent-dark);
	outline-offset: 2px;
}
