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

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

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

.action-button {
	height: 34px;
	padding: 0 12px;
}

.ascii-flow {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	color: #39465a;
	font-size: 12px;
	font-weight: 800;
	overflow-x: auto;
	padding-bottom: 2px;
}

.ascii-flow span:not([aria-hidden]) {
	flex: 0 0 auto;
	border: 1px solid #dbe3ef;
	border-radius: 999px;
	background: #ffffff;
	padding: 6px 10px;
}

.ascii-flow span[aria-hidden] {
	color: #8995a8;
}

.ascii-layout {
	display: grid;
	grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
	gap: 12px;
	align-items: stretch;
}

.ascii-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: #287169;
	font-size: 12px;
	font-weight: 800;
	text-align: right;
}

.drop-zone {
	min-height: 226px;
	margin: 14px;
	border: 2px dashed #b7c5dc;
	border-radius: 8px;
	background: #f8fbff;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 8px;
	padding: 22px;
	text-align: center;
	color: #42526a;
	transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
	border-color: #2f80ed;
	background: #eef6ff;
	transform: translateY(-1px);
}

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

.drop-mark {
	width: 58px;
	height: 58px;
	display: grid;
	place-items: center;
	border: 1px solid #b7d7cd;
	border-radius: 8px;
	background: #eefbf5;
	color: #0f6b52;
	font-family: var(--font-mono);
	font-size: 22px;
	font-weight: 900;
}

.drop-zone strong {
	color: #102033;
	font-size: 17px;
	line-height: 1.25;
}

.drop-zone span:last-child {
	color: #667085;
	font-size: 13px;
	line-height: 1.45;
}

.form-message {
	margin: -4px 14px 14px;
	border: 1px solid #b8d9d1;
	border-left: 4px solid #16865a;
	border-radius: 8px;
	background: #f3fbf8;
	color: #175d4f;
	font-size: 13px;
	font-weight: 750;
	line-height: 1.45;
	padding: 10px 12px;
}

.form-message[hidden],
.image-preview-card[hidden] {
	display: none;
}

.form-message.is-error {
	border-color: #ffd2cc;
	border-left-color: #d92d20;
	background: #fff6f5;
	color: #b42318;
}

.image-preview-card {
	display: grid;
	grid-template-columns: 116px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	margin: 0 14px 14px;
	border: 1px solid #dce3ee;
	border-radius: 8px;
	background: #ffffff;
	padding: 10px;
}

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

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

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

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

.preview-details span {
	color: #667085;
	font-size: 12px;
	font-weight: 800;
}

.ascii-options {
	display: grid;
	gap: 14px;
	padding: 14px;
}

.option-group {
	display: grid;
	gap: 8px;
	min-width: 0;
}

.option-label,
.range-control span {
	color: #344054;
	font-size: 12px;
	font-weight: 850;
	line-height: 1.25;
}

.size-strip,
.charset-strip,
.preset-strip,
.mode-strip {
	display: grid;
	gap: 5px;
	border: 1px solid #d5deeb;
	border-radius: 8px;
	background: #f6f8fb;
	padding: 4px;
}

.size-strip {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.charset-strip {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preset-strip {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.size-button,
.charset-button,
.preset-button,
.mode-button {
	min-height: 35px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #44546a;
	font-size: 12px;
	padding: 0 8px;
}

.size-button:hover,
.charset-button:hover,
.preset-button:hover,
.mode-button:hover {
	background: #edf2f7;
}

.size-button.active {
	background: #2264d1;
	color: #ffffff;
}

.charset-button.active {
	background: #13845f;
	color: #ffffff;
}

.preset-button.active {
	background: #1f2937;
	color: #ffffff;
}

.mode-button.active {
	background: #7c3aed;
	color: #ffffff;
}

.adjust-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.range-control {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 7px;
	align-items: center;
	border: 1px solid #dbe3ef;
	border-radius: 8px;
	background: #ffffff;
	padding: 10px;
}

.range-control input {
	grid-column: 1 / -1;
	width: 100%;
	accent-color: #2264d1;
}

.range-control output {
	min-width: 42px;
	height: 24px;
	display: inline-grid;
	place-items: center;
	border-radius: 999px;
	background: #fff4d6;
	color: #8a4b00;
	font-size: 12px;
	font-weight: 850;
}

.option-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.option-check,
.crop-toggle {
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #dbe3ef;
	border-radius: 8px;
	background: #ffffff;
	color: #344054;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.25;
	padding: 10px;
}

.option-check input,
.crop-toggle input {
	flex: 0 0 auto;
	accent-color: #13845f;
}

.crop-toggle {
	align-items: flex-start;
	cursor: pointer;
}

.crop-toggle input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.toggle-ui {
	position: relative;
	flex: 0 0 42px;
	width: 42px;
	height: 24px;
	border-radius: 999px;
	background: #cbd5e1;
	transition: background .15s ease;
}

.toggle-ui::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
	transition: transform .15s ease;
}

.crop-toggle input:checked + .toggle-ui {
	background: #13845f;
}

.crop-toggle input:checked + .toggle-ui::after {
	transform: translateX(18px);
}

.crop-toggle strong {
	display: block;
	color: #172033;
	font-size: 13px;
	line-height: 1.25;
}

.crop-toggle small {
	display: block;
	margin-top: 3px;
	color: #667085;
	font-size: 12px;
	line-height: 1.35;
}

.generate-button {
	min-height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-color: #0f6b52;
	background: #13845f;
	color: #ffffff;
}

.generate-button:disabled,
.result-button:disabled {
	cursor: not-allowed;
	opacity: .52;
}

.result-panel {
	margin-top: 12px;
}

.result-tools {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 12px 14px 0;
}

.result-button {
	min-height: 34px;
	padding: 0 12px;
}

.result-button.primary {
	border-color: #2264d1;
	background: #2264d1;
	color: #ffffff;
}

.result-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
	gap: 12px;
	padding: 12px 14px 14px;
}

.output-box,
.art-preview-box {
	min-width: 0;
	border: 1px solid #dbe3ef;
	border-radius: 8px;
	background: #ffffff;
	overflow: hidden;
}

.output-head {
	min-height: 38px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	border-bottom: 1px solid #e5eaf3;
	background: #fbfcff;
	padding: 0 10px;
}

.output-head strong {
	color: #172033;
	font-size: 13px;
	line-height: 1.25;
}

.output-head span {
	color: #667085;
	font-size: 12px;
	font-weight: 800;
	text-align: right;
}

.ascii-output,
.ascii-art-preview {
	width: 100%;
	min-height: 360px;
	margin: 0;
	border: 0;
	background: #ffffff;
	color: #111827;
	font-family: Consolas, "JetBrains Mono", "SFMono-Regular", var(--font-mono);
	font-size: 12px;
	line-height: 1;
	letter-spacing: 0;
	white-space: pre;
	overflow: auto;
	padding: 12px;
	tab-size: 4;
}

.ascii-output {
	resize: vertical;
	outline: 0;
}

.ascii-art-preview {
	display: block;
	text-align: left;
}

.ascii-output[data-mode="braille"],
.ascii-art-preview[data-mode="braille"] {
	font-size: 10px;
	line-height: .92;
}

.ascii-output[data-mode="blocks"],
.ascii-art-preview[data-mode="blocks"] {
	font-size: 11px;
	line-height: .94;
}

.result-guide {
	margin: 0;
	border-top: 1px solid #e5eaf3;
	background: #f4fbf7;
	color: #175d4f;
	font-size: 13px;
	font-weight: 750;
	line-height: 1.45;
	padding: 11px 14px;
}

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

@media (max-width: 980px) {
	.ascii-layout,
	.result-grid {
		grid-template-columns: 1fr;
	}
}

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

	.ascii-workspace .page-actions,
	.result-tools,
	.adjust-grid,
	.option-grid {
		display: grid;
		grid-template-columns: 1fr;
	}

	.action-button,
	.result-button {
		width: 100%;
	}

	.size-strip,
	.charset-strip,
	.preset-strip,
	.mode-strip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.image-preview-card {
		grid-template-columns: 88px minmax(0, 1fr);
	}

	.ascii-output,
	.ascii-art-preview {
		min-height: 260px;
		font-size: 11px;
	}
}
