.action-button {
	height: 34px;
	border-radius: 7px;
	border: 1px solid #c7cedf;
	background: #ffffff;
	color: #111827;
	font-weight: 700;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

.action-button.primary {
	background: var(--primary);
	color: #ffffff;
	border-color: #3735c4;
}

.json-xml-workspace {
	padding: 6px 8px;
}

.json-xml-workspace .page-head,
.json-xml-workspace .tool-surface {
	width: 100%;
	max-width: none !important;
	margin-left: 0;
	margin-right: 0;
}

.json-xml-workspace .page-head {
	margin-bottom: 10px;
	padding: 0;
}

.mode-strip {
	display: inline-flex;
	gap: 6px;
	border: 1px solid #d7dcea;
	border-radius: 8px;
	background: #ffffff;
	padding: 4px;
	margin-bottom: 10px;
	box-shadow: var(--shadow);
}

.mode-button {
	height: 30px;
	min-width: 70px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #344054;
	font-weight: 800;
	padding: 0 12px;
}

.mode-button:hover {
	background: #f0f4fb;
}

.mode-button.active {
	background: var(--primary);
	color: #ffffff;
}

.viewer-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	align-items: stretch;
}

.single-terminal,
.result-panel {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--panel);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.single-terminal {
	background: var(--ink);
	color: #e7edff;
}

.terminal-head,
.panel-head {
	min-height: 46px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 10px;
	border-bottom: 1px solid #e2e6f0;
}

.panel-head {
	flex-wrap: wrap;
}

.terminal-head {
	background: #071625;
	color: #f1f6ff;
	border-bottom-color: #20354d;
}

.terminal-title,
.panel-title {
	font-size: 15px;
	font-weight: 800;
	margin: 0;
}

.data-editor,
.result-body {
	height: clamp(420px, calc(100vh - 330px), 660px);
	min-height: 420px;
}

.data-editor {
	width: 100%;
	border: 0;
	background: var(--ink);
	color: #f7fbff;
	resize: vertical;
	padding: 12px;
	outline: 0;
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	overflow-x: hidden;
	display: block;
}

.status,
.meta {
	color: #8fdcff;
	font-size: 12px;
	font-weight: 800;
}

.result-tools {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	min-width: 0;
}

.view-switch {
	display: inline-flex;
	gap: 4px;
	border: 1px solid #d7dcea;
	border-radius: 7px;
	background: #ffffff;
	padding: 3px;
}

.view-button {
	height: 28px;
	min-width: 48px;
	border: 0;
	border-radius: 5px;
	background: transparent;
	color: #344054;
	font-size: 12px;
	font-weight: 800;
	padding: 0 9px;
}

.view-button:hover {
	background: #f0f4fb;
}

.view-button.active {
	background: var(--primary);
	color: #ffffff;
}

.result-body {
	background: #ffffff;
	padding: 12px;
	overflow: auto;
}

.formatted-output {
	margin: 0;
	min-height: 100%;
	background: #f4f7fb;
	border: 1px solid #e3e8f2;
	border-radius: 7px;
	padding: 12px;
	overflow: auto;
	color: #102033;
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 1.55;
	white-space: pre;
}

.formatted-output[hidden],
.table-output[hidden] {
	display: none;
}

.formatted-output code {
	font: inherit;
	color: inherit;
}

.table-output {
	min-height: 100%;
	overflow: auto;
}

.table-output table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	background: #ffffff;
	color: #102033;
	font-size: 13px;
	line-height: 1.45;
}

.table-output th,
.table-output td {
	border: 1px solid #dbe2ed;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.table-output tbody tr:nth-child(even) {
	background: #fbfcff;
}

.table-output tbody tr:hover {
	background: #eef4ff;
}

.table-row-container {
	background: #f7f9fc;
}

.table-row-container .table-key {
	font-weight: 800;
}

.table-output th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #eef3f8;
	color: #22324a;
	font-weight: 800;
}

.table-path,
.table-key,
.table-type {
	font-family: var(--font-mono);
}

.table-type {
	width: 96px;
}

.table-key {
	padding-left: calc(10px + (var(--depth, 0) * 16px)) !important;
	white-space: nowrap;
}

.tree-marker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	margin-right: 4px;
	color: #7b879d;
	font-family: var(--font-sans);
	font-weight: 800;
}

.tree-marker-container {
	color: #364fc7;
}

.tree-label {
	vertical-align: middle;
}

.type-badge {
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	border-radius: 999px;
	background: #eef2ff;
	color: #364fc7;
	font-family: var(--font-sans);
	font-size: 12px;
	font-weight: 800;
	padding: 0 8px;
}

.type-array,
.type-object,
.type-element {
	background: #e7f0ff;
	color: #155eef;
}

.type-attribute,
.type-string {
	background: #edf7ee;
	color: #217a3a;
}

.type-number,
.type-boolean {
	background: #fff4df;
	color: #996300;
}

.type-null {
	background: #f2f4f7;
	color: #667085;
}

.viewer-message {
	margin: 0 0 10px;
	border: 1px solid #d7dcea;
	border-radius: 7px;
	background: #f8fafc;
	color: #344054;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
}

.viewer-message[hidden] {
	display: none;
}

.viewer-message.is-error {
	border-color: #f4b7b0;
	background: #fff5f4;
	color: #b42318;
}

.copy-dialog {
	position: fixed;
	top: 76px;
	right: 22px;
	bottom: auto;
	z-index: 90;
	width: min(360px, calc(100vw - 28px));
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	border: 1px solid #ccd4e5;
	border-left: 4px solid var(--primary);
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
	padding: 12px 12px 12px 10px;
	opacity: 0;
	transform: translateY(10px);
	pointer-events: none;
	transition: opacity .16s ease, transform .16s ease;
}

.copy-dialog[hidden] {
	display: none;
}

.copy-dialog.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.copy-dialog.is-error {
	border-left-color: #d92d20;
}

.copy-dialog-icon {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #eef0ff;
	position: relative;
}

.copy-dialog-icon::after {
	content: "";
	position: absolute;
	left: 11px;
	top: 8px;
	width: 9px;
	height: 15px;
	border-right: 3px solid var(--primary);
	border-bottom: 3px solid var(--primary);
	transform: rotate(42deg);
}

.copy-dialog.is-error .copy-dialog-icon {
	background: #fff1f0;
}

.copy-dialog.is-error .copy-dialog-icon::before,
.copy-dialog.is-error .copy-dialog-icon::after {
	content: "";
	position: absolute;
	left: 10px;
	top: 15px;
	width: 14px;
	height: 3px;
	border: 0;
	background: #d92d20;
	transform: rotate(45deg);
}

.copy-dialog.is-error .copy-dialog-icon::after {
	transform: rotate(-45deg);
}

.copy-dialog-content {
	min-width: 0;
}

.copy-dialog-content strong {
	display: block;
	color: var(--text);
	font-size: 14px;
	line-height: 1.25;
}

.copy-dialog-content p {
	margin: 3px 0 0;
	color: #475467;
	font-size: 13px;
	line-height: 1.35;
}

.copy-dialog-close {
	height: 30px;
	border: 1px solid #c7cedf;
	border-radius: 7px;
	background: #ffffff;
	color: #22324a;
	font-size: 12px;
	font-weight: 800;
	padding: 0 9px;
}

.clipboard-fallback {
	position: fixed;
	left: -9999px;
	top: 0;
	opacity: 0;
}

@media (max-width: 900px) {
	.json-xml-workspace {
		padding: 6px;
	}

	.json-xml-workspace .page-head {
		gap: 26px;
		margin-bottom: 34px;
	}

	.mode-strip {
		margin-bottom: 30px;
	}

	.viewer-grid {
		grid-template-columns: 1fr;
		gap: 36px;
	}

	.data-editor,
	.result-body {
		height: 360px;
		min-height: 360px;
	}

	.copy-dialog {
		top: 70px;
		right: auto;
		left: 50%;
		transform: translate(-50%, 10px);
	}

	.copy-dialog.is-visible {
		transform: translate(-50%, 0);
	}

	.result-tools {
		width: 100%;
		justify-content: space-between;
	}
}

@media (max-width: 560px) {
	.json-xml-workspace .page-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
		gap: 10px;
	}

	.action-button {
		width: 100%;
		justify-content: center;
	}

	.mode-strip {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		width: 100%;
	}

	.mode-button {
		min-width: 0;
	}
}
