:root {
	color-scheme: light;
	--bg: #f0f0f1;
	--panel: #fff;
	--panel-alt: #f6f7f7;
	--ink: #1d2327;
	--muted: #646970;
	--line: #c3c4c7;
	--line-soft: #dcdcde;
	--dark: #1d2327;
	--blue: #2271b1;
	--blue-dark: #135e96;
	--blue-soft: #e7f2fb;
	--yellow: #996800;
	--yellow-soft: #fcf9e8;
	--red: #b32d2e;
	--red-soft: #fcf0f1;
	--green: #008a20;
	--green-soft: #edfaef;
	--shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-width: 320px;
	background: var(--bg);
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

button,
input,
select {
	font: inherit;
}

button,
input,
select {
	border: 1px solid var(--line);
	border-radius: 3px;
	background: #fff;
	color: var(--ink);
}

button {
	min-height: 32px;
	padding: 5px 10px;
	font-weight: 600;
	cursor: pointer;
}

button:hover {
	border-color: var(--blue);
	color: var(--blue-dark);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

input,
select {
	min-height: 32px;
	padding: 5px 8px;
	min-width: 0;
}

input {
	width: 100%;
}

h1,
h2,
h3,
p,
dl {
	margin-top: 0;
}

h1 {
	margin-bottom: 4px;
	font-size: 26px;
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: 0;
}

h2 {
	margin-bottom: 0;
	font-size: 20px;
	line-height: 1.25;
	font-weight: 600;
	letter-spacing: 0;
}

h3 {
	margin-bottom: 8px;
	font-size: 15px;
	line-height: 1.3;
	letter-spacing: 0;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

th,
td {
	padding: 9px 10px;
	border-bottom: 1px solid var(--line-soft);
	text-align: left;
	vertical-align: top;
}

thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var(--panel-alt);
	color: #2c3338;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
}

tbody tr:hover {
	background: #f6fbff;
}

tbody tr.selected {
	background: var(--blue-soft);
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	display: grid;
	grid-template-columns: 240px minmax(220px, 1fr) auto;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 14px;
	background: var(--dark);
	color: #f0f0f1;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: #fff;
	text-decoration: none;
	min-width: 0;
}

.brand strong,
.brand small,
.row-title,
.row-sub {
	display: block;
}

.brand small {
	color: #a7aaad;
	font-size: 12px;
}

.wp-logo {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: #fff;
	color: #111;
	font-family: Georgia, serif;
	font-size: 20px;
	font-weight: 700;
}

.pathbar {
	display: grid;
	grid-template-columns: auto auto minmax(140px, 1fr) auto;
	align-items: center;
	gap: 7px;
	min-width: 0;
}

.pathbar label {
	color: #a7aaad;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
}

.pathbar input {
	border-color: #3c434a;
	background: #2c3338;
	color: #f6f7f7;
}

.topbar button {
	border-color: #50575e;
	background: #2c3338;
	color: #f0f0f1;
}

.topbar .primary,
.primary {
	border-color: var(--blue);
	background: var(--blue);
	color: #fff;
}

.primary:hover {
	border-color: var(--blue-dark);
	background: var(--blue-dark);
	color: #fff;
}

.icon-button {
	width: 32px;
	padding: 0;
}

.top-actions,
.heading-actions,
.toolbar-controls,
.row-actions,
.button-row,
.filter-pills,
.manager-tabs {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
}

.top-actions {
	justify-content: flex-end;
}

.status-dot {
	position: relative;
	padding-left: 16px;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.status-dot::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	transform: translateY(-50%);
	background: currentColor;
}

.status-dot.warning {
	color: #ffcc33;
}

.layout {
	display: grid;
	grid-template-columns: 184px minmax(0, 1fr);
	min-height: calc(100vh - 48px);
	min-width: 0;
}

.sidebar {
	position: sticky;
	top: 48px;
	align-self: start;
	min-height: calc(100vh - 48px);
	min-width: 0;
	max-width: 100%;
	padding: 14px 0;
	background: #2c3338;
}

.sidebar a {
	display: block;
	padding: 9px 18px;
	border-left: 4px solid transparent;
	color: #c3c4c7;
	text-decoration: none;
	font-weight: 600;
}

.sidebar a:hover,
.sidebar a.active {
	border-left-color: var(--blue);
	background: #1d2327;
	color: #fff;
}

main {
	padding: 18px;
	min-width: 0;
}

.screen {
	max-width: 1420px;
	margin: 0 auto 22px;
	padding: 18px;
	border: 1px solid var(--line-soft);
	background: var(--panel);
	box-shadow: var(--shadow);
	min-width: 0;
}

.first-screen {
	min-height: calc(100vh - 84px);
}

.screen-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.screen-heading.compact {
	align-items: center;
}

.eyebrow {
	margin-bottom: 2px;
	color: var(--blue-dark);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0;
}

.lede {
	max-width: 760px;
	margin-bottom: 0;
	color: var(--muted);
}

.notice {
	margin-bottom: 14px;
	padding: 9px 11px;
	border-left: 4px solid var(--blue);
	background: var(--blue-soft);
	color: #1d2327;
}

.warning-notice {
	border-left-color: #dba617;
	background: var(--yellow-soft);
}

.danger-notice {
	border-left-color: var(--red);
	background: var(--red-soft);
}

.info-notice {
	background: #f0f6fc;
}

.register-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 14px;
	align-items: start;
	min-width: 0;
}

.table-panel,
.workflow,
.detail-card,
.manager-panel,
.wp-preview,
.transfer-grid article {
	border: 1px solid var(--line);
	background: var(--panel);
	min-width: 0;
}

.panel-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--line-soft);
	background: var(--panel-alt);
	min-width: 0;
}

.panel-toolbar h2,
.panel-toolbar h3 {
	margin-bottom: 0;
}

.panel-toolbar span {
	color: var(--muted);
	font-size: 12px;
}

.toolbar-controls {
	justify-content: flex-end;
	min-width: min(430px, 100%);
}

.toolbar-controls input {
	width: 230px;
}

.table-wrap {
	max-width: 100%;
	width: 100%;
	min-width: 0;
	overflow-x: auto;
}

.row-title {
	font-weight: 700;
}

.row-sub {
	color: var(--muted);
	font-size: 12px;
	font-weight: 400;
}

.badge {
	display: inline-flex;
	align-items: center;
	min-height: 23px;
	padding: 2px 7px;
	border: 1px solid #b8cbe0;
	border-radius: 999px;
	background: #f0f6fc;
	color: #1d4f7a;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.badge.warn {
	border-color: #e6cc85;
	background: var(--yellow-soft);
	color: var(--yellow);
}

.badge.good {
	border-color: #93c99c;
	background: var(--green-soft);
	color: #006b18;
}

.badge.local {
	border-color: #a7aaad;
	background: #f6f7f7;
	color: #3c434a;
}

.row-actions {
	min-width: 220px;
}

.row-actions button {
	min-height: 28px;
	padding: 3px 7px;
	font-size: 12px;
}

.workflow {
	position: sticky;
	top: 66px;
	padding: 14px;
}

.workflow-header {
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line-soft);
}

.workflow-header p {
	margin-bottom: 0;
	color: var(--muted);
}

.workflow-body {
	display: grid;
	gap: 12px;
	padding-top: 12px;
}

.workflow label,
.manager-panel label {
	display: grid;
	gap: 5px;
	font-weight: 600;
}

fieldset {
	display: grid;
	gap: 7px;
	margin: 0;
	padding: 10px;
	border: 1px solid var(--line-soft);
}

legend {
	padding: 0 4px;
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
}

.choice,
.checkbox {
	display: flex !important;
	grid-template-columns: none !important;
	align-items: center;
	gap: 8px !important;
	font-weight: 500 !important;
}

.choice input,
.checkbox input {
	width: auto;
}

.choice.checked {
	color: var(--blue-dark);
	font-weight: 700 !important;
}

.progress-row {
	display: grid;
	gap: 6px;
	padding: 9px;
	background: var(--panel-alt);
}

meter {
	width: 100%;
	height: 9px;
}

.flow-steps {
	margin: 0;
	padding-left: 22px;
}

.flow-steps li {
	margin-bottom: 6px;
	color: var(--muted);
}

.flow-steps li.done {
	color: var(--green);
}

.flow-steps li.active {
	color: var(--blue-dark);
	font-weight: 700;
}

.danger {
	border-color: var(--red);
	background: var(--red);
	color: #fff;
}

.danger:hover {
	border-color: #8a2424;
	background: #8a2424;
	color: #fff;
}

.source-table input {
	min-width: 260px;
}

.file-input {
	display: inline-block;
	width: 100%;
	min-width: 230px;
	padding: 6px 8px;
	border: 1px dashed var(--line);
	background: var(--panel-alt);
	color: var(--muted);
}

.filter-pills button,
.manager-tabs button {
	border-radius: 999px;
	background: var(--panel-alt);
	color: #50575e;
}

.filter-pills button.active,
.manager-tabs button.active {
	border-color: var(--blue);
	background: var(--blue);
	color: #fff;
}

.catalog-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 14px;
	align-items: start;
	min-width: 0;
}

.detail-card {
	padding: 14px;
}

.thumb {
	display: grid;
	align-content: end;
	gap: 5px;
	min-height: 150px;
	margin-bottom: 12px;
	padding: 12px;
	border: 1px solid var(--line);
	background:
		linear-gradient(90deg, rgba(34, 113, 177, 0.12), rgba(34, 113, 177, 0.02)),
		repeating-linear-gradient(0deg, #fff, #fff 18px, #f0f0f1 19px);
	color: #1d2327;
	font-weight: 700;
}

.thumb span {
	display: block;
	max-width: 220px;
	padding: 3px 6px;
	background: rgba(255, 255, 255, 0.9);
}

dl div {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	gap: 8px;
	padding: 7px 0;
	border-bottom: 1px solid var(--line-soft);
}

dt {
	color: var(--muted);
	font-weight: 700;
}

dd {
	margin: 0;
}

.manager-tabs {
	margin-bottom: 12px;
}

.manager-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
	gap: 14px;
	align-items: start;
	min-width: 0;
}

.manager-panel {
	display: none;
	padding: 14px;
	min-height: 410px;
}

.manager-panel.active {
	display: block;
}

.settings-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(160px, 1fr));
	gap: 12px;
	margin-bottom: 14px;
}

.split-tool {
	display: grid;
	grid-template-columns: 210px minmax(0, 1fr);
	border: 1px solid var(--line-soft);
	margin-bottom: 12px;
	min-height: 260px;
}

.file-tree {
	margin: 0;
	padding: 8px 0;
	border-right: 1px solid var(--line-soft);
	background: var(--panel-alt);
	list-style: none;
}

.file-tree li {
	padding: 6px 12px;
}

.file-tree .selected {
	border-left: 3px solid var(--blue);
	background: #fff;
	font-weight: 700;
}

.file-tree .open {
	font-weight: 700;
}

.code {
	margin: 0;
	padding: 12px;
	overflow: auto;
	background: #fff;
	color: #1d2327;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 13px;
	line-height: 1.6;
}

.facts {
	margin-bottom: 12px;
}

.facts th {
	width: 150px;
	background: var(--panel-alt);
}

.wp-preview {
	overflow: hidden;
	background: #fff;
}

.preview-adminbar {
	padding: 8px 12px;
	background: #1d2327;
	color: #fff;
	font-size: 12px;
}

.preview-page {
	padding: 22px;
}

.preview-page header {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 52px;
}

.preview-page header span {
	color: #3c434a;
}

.preview-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 210px;
	align-items: center;
	gap: 20px;
}

.preview-content h3 {
	font-family: Georgia, serif;
	font-size: 32px;
	font-weight: 400;
	color: #3858e9;
}

.preview-mark {
	display: grid;
	place-items: center;
	width: 190px;
	height: 190px;
	border: 13px solid #1d2327;
	border-radius: 50%;
	color: #1d2327;
	font-family: Georgia, serif;
	font-size: 112px;
	font-weight: 700;
}

.transfer-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.transfer-grid article {
	padding: 14px;
}

@media (max-width: 1120px) {
	.topbar {
		grid-template-columns: 1fr;
	}

	.top-actions {
		justify-content: flex-start;
	}

	.layout {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: sticky;
		top: 48px;
		z-index: 20;
		display: flex;
		width: 100%;
		max-width: 100vw;
		min-height: auto;
		overflow-x: auto;
		padding: 0;
	}

	.sidebar a {
		white-space: nowrap;
		border-left: 0;
		border-bottom: 3px solid transparent;
	}

	.sidebar a.active,
	.sidebar a:hover {
		border-bottom-color: var(--blue);
	}

	.register-grid,
	.catalog-grid,
	.manager-grid {
		grid-template-columns: 1fr;
	}

	.workflow {
		position: static;
	}

	.wp-preview {
		order: -1;
	}
}

@media (max-width: 760px) {
	main {
		padding: 10px;
	}

	.screen {
		padding: 12px;
	}

	.screen-heading,
	.screen-heading.compact,
	.panel-toolbar {
		display: grid;
		grid-template-columns: 1fr;
	}

	.heading-actions,
	.toolbar-controls,
	.top-actions,
	.button-row {
		align-items: stretch;
	}

	.heading-actions button,
	.toolbar-controls input,
	.toolbar-controls select,
	.top-actions button,
	.button-row button {
		width: 100%;
	}

	.pathbar {
		grid-template-columns: auto minmax(0, 1fr) auto;
	}

	.pathbar label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.source-table input,
	.file-input {
		min-width: 0;
	}

	th,
	td {
		padding: 8px;
	}

	.settings-grid,
	.split-tool,
	.preview-content,
	.transfer-grid {
		grid-template-columns: 1fr;
	}

	.file-tree {
		border-right: 0;
		border-bottom: 1px solid var(--line-soft);
	}

	.preview-page header {
		display: grid;
		margin-bottom: 28px;
	}

	.preview-mark {
		width: 140px;
		height: 140px;
		font-size: 78px;
	}
}

@media (max-width: 520px) {
	body {
		font-size: 13px;
	}

	h1 {
		font-size: 22px;
	}

	h2 {
		font-size: 18px;
	}

	.brand small,
	.status-dot {
		display: none;
	}

	.filter-pills,
	.manager-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
	}

	.filter-pills button,
	.manager-tabs button {
		white-space: nowrap;
	}
}
