.base64-workspace {
	padding: 18px 20px;
}

.base64-workspace .page-head,
.base64-workspace .tool-surface {
	width: 100%;
	max-width: 1180px;
}

.action-button,
.mode-button {
	border: 1px solid #c9d2e3;
	border-radius: 7px;
	background: #ffffff;
	color: #142033;
	font-weight: 800;
	white-space: nowrap;
}

.action-button {
	height: 34px;
	display: inline-flex;
	align-items: center;
	padding: 0 12px;
}

.action-button.primary {
	border-color: #175cd3;
	background: #175cd3;
	color: #ffffff;
}

.codec-toolbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 10px;
	align-items: start;
	margin-bottom: 12px;
}

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

.mode-button {
	height: 32px;
	min-width: 74px;
	border: 0;
	background: transparent;
	color: #344054;
	padding: 0 12px;
}

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

.mode-button.active {
	background: #175cd3;
	color: #ffffff;
}

.option-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	min-width: 0;
}

.option-pill {
	min-height: 40px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid #d9e1ee;
	border-radius: 8px;
	background: #ffffff;
	color: #344054;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
	padding: 0 10px;
}

.option-pill input {
	accent-color: #137a63;
}

.codec-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 12px;
	align-items: stretch;
}

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

.panel-head {
	min-height: 46px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 0 14px;
	border-bottom: 1px solid #e2e7f0;
	background: #ffffff;
}

.panel-title {
	margin: 0;
	color: #101828;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
}

.meta {
	color: #16705e;
	font-size: 12px;
	font-weight: 800;
	text-align: right;
}

.codec-editor {
	width: 100%;
	height: clamp(300px, calc(100vh - 430px), 520px);
	min-height: 300px;
	display: block;
	border: 0;
	background: #fbfcff;
	color: #111827;
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 1.55;
	letter-spacing: 0;
	resize: vertical;
	outline: 0;
	padding: 12px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	tab-size: 4;
}

.source-panel .codec-editor {
	background: #081d31;
	color: #f7fbff;
}

.result-editor {
	background: #f7f9fc;
}

.file-drop {
	min-height: 92px;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	border-top: 1px solid #20354d;
	background: #0d263f;
	color: #eaf2ff;
	padding: 14px;
	cursor: pointer;
	transition: background .15s ease;
}

.file-drop:hover,
.file-drop.is-dragging {
	background: #123455;
}

.file-drop input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.file-drop-icon {
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	flex: 0 0 46px;
	border: 1px solid #78dec7;
	border-radius: 8px;
	background: #103b3a;
	color: #bff9e8;
	font-family: var(--font-mono);
	font-size: 17px;
	font-weight: 900;
}

.file-drop strong,
.file-drop small {
	display: block;
	line-height: 1.35;
}

.file-drop strong {
	font-size: 14px;
	font-weight: 850;
}

.file-drop small {
	margin-top: 3px;
	color: #b8c7da;
	font-size: 12px;
	font-weight: 700;
}

.codec-message {
	min-height: 45px;
	margin: 0;
	border-top: 1px solid #e0e6f1;
	background: #f2fbf8;
	color: #175d4f;
	font-size: 13px;
	font-weight: 750;
	line-height: 1.45;
	padding: 12px 14px;
}

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

.codec-message.is-error {
	background: #fff5f4;
	color: #b42318;
}

.assist-grid {
	display: grid;
	grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
	gap: 12px;
	margin-top: 12px;
}

.file-panel[hidden],
.jwt-panel[hidden],
.preview-frame[hidden] {
	display: none;
}

.file-info {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	padding: 12px;
}

.preview-frame {
	aspect-ratio: 1;
	border-radius: 8px;
	background: #eef2f6;
	overflow: hidden;
	display: grid;
	place-items: center;
}

.preview-frame img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.file-details {
	min-width: 0;
	display: grid;
	gap: 5px;
}

.file-details strong {
	color: #15243a;
	font-size: 14px;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.file-details span {
	color: #667085;
	font-size: 12px;
	font-weight: 800;
	overflow-wrap: anywhere;
}

.jwt-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	padding: 12px;
}

.jwt-block {
	min-width: 0;
	border: 1px solid #dbe3ef;
	border-radius: 8px;
	background: #ffffff;
	overflow: hidden;
}

.jwt-block strong {
	display: block;
	border-bottom: 1px solid #e5eaf3;
	background: #fbfcff;
	color: #172033;
	font-size: 13px;
	line-height: 1.25;
	padding: 10px;
}

.jwt-block pre {
	min-height: 160px;
	max-height: 280px;
	margin: 0;
	overflow: auto;
	background: #ffffff;
	color: #111827;
	font-family: var(--font-mono);
	font-size: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	padding: 10px;
}

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

@media (max-width: 980px) {
	.codec-toolbar,
	.codec-grid,
	.assist-grid,
	.jwt-grid {
		grid-template-columns: 1fr;
	}

	.mode-strip {
		width: 100%;
	}

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

@media (max-width: 640px) {
	.base64-workspace {
		padding: 14px 12px;
	}

	.base64-workspace .page-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
		gap: 8px;
	}

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

	.option-strip {
		display: grid;
		grid-template-columns: 1fr;
	}

	.option-pill {
		width: 100%;
	}

	.codec-editor {
		height: 260px;
		min-height: 260px;
	}

	.file-drop {
		align-items: flex-start;
	}

	.file-info {
		grid-template-columns: 88px minmax(0, 1fr);
	}
}
