.tgb-resizer {
	--tgb-blue: #1769e0;
	--tgb-blue-dark: #0f55bb;
	--tgb-border: #dbe3ee;
	--tgb-muted: #65758b;
	--tgb-text: #172033;
	box-sizing: border-box;
	color: var(--tgb-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	margin: 24px auto;
	max-width: 1040px;
}

.tgb-resizer *,
.tgb-resizer *::before,
.tgb-resizer *::after {
	box-sizing: inherit;
}

.tgb-resizer [hidden] {
	display: none !important;
}

.tgb-card {
	background: #fff;
	border: 1px solid #e8edf3;
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba(24, 45, 76, .1);
	padding: 28px;
}

.tgb-privacy {
	align-items: center;
	background: #eef6ff;
	border: 1px solid #d4e8ff;
	border-radius: 10px;
	color: #174a86;
	display: flex;
	font-size: 14px;
	gap: 9px;
	margin: 0 0 22px;
	padding: 12px 14px;
}

.tgb-dropzone {
	align-items: center;
	background: #f8fbff;
	border: 2px dashed #a8c7ec;
	border-radius: 14px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: center;
	min-height: 220px;
	padding: 28px;
	text-align: center;
	transition: background .2s, border-color .2s, transform .2s;
}

.tgb-dropzone:hover,
.tgb-dropzone:focus-visible,
.tgb-dropzone.is-dragging {
	background: #eff7ff;
	border-color: var(--tgb-blue);
	outline: none;
	transform: translateY(-1px);
}

.tgb-file-input {
	height: 1px;
	opacity: 0;
	overflow: hidden;
	position: absolute;
	width: 1px;
}

.tgb-upload-icon {
	align-items: center;
	background: var(--tgb-blue);
	border-radius: 50%;
	color: #fff;
	display: flex;
	font-size: 27px;
	font-weight: 700;
	height: 50px;
	justify-content: center;
	margin-bottom: 4px;
	width: 50px;
}

.tgb-dropzone > strong {
	color: #172b4d;
	font-size: 22px;
	line-height: 1.25;
}
.tgb-dropzone span,
.tgb-dropzone small { color: var(--tgb-muted); }

.tgb-format-list {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	justify-content: center;
	margin-top: 8px;
}

.tgb-format-list span {
	background: #fff;
	border: 1px solid #cfe0f5;
	border-radius: 5px;
	color: #496886;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .02em;
	padding: 3px 6px;
}

.tgb-error {
	background: #fff1f1;
	border: 1px solid #ffcaca;
	border-radius: 9px;
	color: #a41e1e;
	margin-top: 14px;
	padding: 11px 13px;
}

.tgb-workspace {
	display: grid;
	gap: 30px;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
	margin-top: 26px;
}

.tgb-preview-wrap {
	align-items: center;
	background: #f1f4f8;
	border-radius: 12px;
	display: flex;
	justify-content: center;
	min-height: 300px;
	overflow: hidden;
	padding: 14px;
	position: relative;
}

.tgb-preview-wrap canvas {
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #e9edf2 25%, transparent 25%),
		linear-gradient(-45deg, #e9edf2 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #e9edf2 75%),
		linear-gradient(-45deg, transparent 75%, #e9edf2 75%);
	background-position: 0 0, 0 8px, 8px -8px, -8px 0;
	background-size: 16px 16px;
	box-shadow: 0 5px 18px rgba(28, 45, 70, .12);
	display: block;
	max-height: 410px;
	max-width: 100%;
	object-fit: contain;
}

.tgb-live-badge {
	background: rgba(20, 34, 55, .82);
	border-radius: 999px;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	left: 24px;
	padding: 5px 9px;
	position: absolute;
	top: 24px;
	z-index: 1;
}

.tgb-preview-empty {
	align-items: center;
	color: var(--tgb-muted);
	display: flex;
	flex-direction: column;
	gap: 5px;
	text-align: center;
}

.tgb-preview-empty > span {
	color: #9eb1c8;
	font-size: 44px;
	line-height: 1;
}

.tgb-preview-empty small {
	font-size: 13px;
}

.tgb-meta {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr 1fr;
	margin: 14px 0;
}

.tgb-meta div,
.tgb-result > div {
	background: #f7f9fc;
	border-radius: 9px;
	display: flex;
	flex-direction: column;
	padding: 10px 12px;
}

.tgb-meta span,
.tgb-result span {
	color: var(--tgb-muted);
	font-size: 12px;
	margin-bottom: 2px;
}

.tgb-settings h3 { font-size: 20px; margin: 0 0 16px; }

.tgb-dimensions {
	align-items: flex-end;
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr auto 1fr;
}

.tgb-settings label > span,
.tgb-presets legend {
	color: #34445a;
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 7px;
}

.tgb-settings input[type="number"],
.tgb-settings select {
	background: #fff;
	border: 1px solid var(--tgb-border);
	border-radius: 8px;
	color: var(--tgb-text);
	font: inherit;
	height: 44px;
	padding: 0 11px;
	width: 100%;
}

.tgb-method-row {
	background: #f7faff;
	border: 1px solid #e1ebf7;
	border-radius: 11px;
	display: grid;
	gap: 12px;
	grid-template-columns: 1.35fr .65fr;
	margin-bottom: 20px;
	padding: 13px;
}

.tgb-settings input:focus,
.tgb-settings select:focus {
	border-color: var(--tgb-blue);
	box-shadow: 0 0 0 3px rgba(23, 105, 224, .13);
	outline: none;
}

.tgb-times { color: var(--tgb-muted); font-size: 22px; padding-bottom: 8px; }

.tgb-check {
	align-items: center;
	display: flex;
	gap: 8px;
	margin: 13px 0 18px;
}

.tgb-check input { accent-color: var(--tgb-blue); height: 17px; width: 17px; }
.tgb-check span { margin: 0 !important; }

.tgb-presets { border: 0; margin: 0 0 20px; padding: 0; }
.tgb-presets div { display: flex; flex-wrap: wrap; gap: 7px; }

.tgb-presets button {
	background: #f2f6fb;
	border: 1px solid var(--tgb-border);
	border-radius: 7px;
	color: #34445a;
	cursor: pointer;
	font-size: 12px;
	padding: 7px 9px;
}

.tgb-presets button:hover,
.tgb-presets button:focus-visible {
	background: #e5f0ff;
	border-color: #91b9ed;
	outline: none;
}

.tgb-output-row {
	display: grid;
	gap: 20px;
	grid-template-columns: .8fr 1.2fr;
	margin-bottom: 20px;
}

.tgb-output-row input[type="range"] { accent-color: var(--tgb-blue); margin: 7px 0; width: 100%; }

.tgb-button {
	border: 0;
	border-radius: 9px;
	cursor: pointer;
	font: inherit;
	font-weight: 650;
	min-height: 44px;
	padding: 10px 16px;
	transition: background .2s, transform .15s;
}

.tgb-button:hover { transform: translateY(-1px); }
.tgb-button:focus-visible { box-shadow: 0 0 0 3px rgba(23, 105, 224, .2); outline: none; }
.tgb-button:disabled { cursor: wait; opacity: .65; transform: none; }
.tgb-action .tgb-button { width: 100%; }
.tgb-button-primary { background: var(--tgb-blue); color: #fff; width: 100%; }
.tgb-button-primary:hover { background: var(--tgb-blue-dark); }
.tgb-button-secondary { background: #edf2f7; color: #33445a; width: 100%; }
.tgb-resizer .tgb-button-download {
	align-items: center;
	background: linear-gradient(135deg, #079b68 0%, #087a55 100%);
	border: 1px solid rgba(0, 91, 59, .35);
	box-shadow: 0 9px 22px rgba(8, 122, 85, .24);
	color: #fff !important;
	display: flex;
	font-size: 18px;
	gap: 10px;
	justify-content: center;
	min-height: 58px;
	text-decoration: none !important;
	white-space: nowrap;
}

.tgb-resizer .tgb-button-download:hover {
	background: linear-gradient(135deg, #07885d 0%, #066746 100%);
	box-shadow: 0 11px 26px rgba(8, 122, 85, .3);
	color: #fff !important;
}

.tgb-download-icon {
	align-items: center;
	background: rgba(255, 255, 255, .18);
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 50%;
	color: #fff !important;
	display: inline-flex;
	font-size: 22px;
	height: 34px;
	justify-content: center;
	line-height: 1;
	width: 34px;
}
.tgb-button-clear { background: #fff1f1; color: #a32929; }
.tgb-button-clear:hover { background: #ffe2e2; }

.tgb-preview-actions {
	display: grid;
	gap: 9px;
	grid-template-columns: minmax(0, 1fr) auto;
}

.tgb-result {
	align-items: center;
	background: #f0fbf6;
	border: 1px solid #c7ead9;
	border-radius: 11px;
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-top: 16px;
	padding: 12px;
	text-align: center;
}

.tgb-result span {
	margin: 0;
}

@media (max-width: 720px) {
	.tgb-card { border-radius: 12px; padding: 18px; }
	.tgb-workspace { grid-template-columns: 1fr; }
	.tgb-preview-wrap { min-height: 230px; }
	.tgb-method-row { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
	.tgb-resizer { margin: 14px auto; }
	.tgb-dropzone { min-height: 190px; padding: 20px 12px; }
	.tgb-meta,
	.tgb-output-row { grid-template-columns: 1fr; }
	.tgb-result { flex-wrap: wrap; }
	.tgb-preview-actions { grid-template-columns: 1fr; }
}
