.bento-section {
	--bento-cols: 12;
	--bento-gap: 16px;
	--bento-card-min-h: 340px;
	--bento-card-bg: var(--background);
	--bento-card-border: transparent;
	--bento-card-border-hover: transparent;
	--bento-card-shadow:
		0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.05),
		0 12px 24px rgba(0, 0, 0, 0.05);
	--bento-card-shadow-hover:
		0 0 0 1px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.06),
		0 16px 32px rgba(0, 0, 0, 0.07);
	--bento-line: var(--ii-border);
	--bento-dot: rgba(0, 0, 0, 0.1);
	--bento-zoom-hover: 1.04;
}

.dark .bento-section {
	--bento-card-border: rgba(255, 255, 255, 0.1);
	--bento-card-border-hover: rgba(255, 255, 255, 0.16);
	--bento-card-shadow: inset 0 -20px 80px -20px #ffffff1f;
	--bento-card-shadow-hover: inset 0 -20px 80px -20px #ffffff29;
	--bento-line: rgba(255, 255, 255, 0.1);
	--bento-dot: rgba(255, 255, 255, 0.09);
}

.bento-hidden-title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.bento-head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--ii-space-3);
	max-width: 880px;
	margin: 0 auto;
	text-align: center;
}

.bento-head .bento-head-title {
	font-size: var(--ii-fs-6xl);
	letter-spacing: -1.4px;
}

.bento-head .bento-head-desc {
	max-width: 800px;
	font-size: var(--ii-fs-lg);
}

.bento-head-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--ii-space-3);
	margin-top: var(--ii-space-3);
}

.bento-head .bento-head-cta {
	padding: 14px var(--ii-space-8);
	border-radius: var(--ii-radius-lg);
	font-size: var(--ii-fs-md);
}

.bento-head-cta svg {
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-head-cta:hover svg {
	transform: translateX(3px);
}

.bento-head + .bento-grid {
	margin-top: var(--ii-home-rows-gap);
}

.bento-split {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	align-items: center;
	gap: clamp(32px, 5vw, 72px);
}

.bento-split .bento-head {
	align-items: flex-start;
	max-width: none;
	margin: 0;
	text-align: left;
}

.bento-split .bento-head-actions {
	justify-content: flex-start;
}

.bento-split .bento-head + .bento-grid {
	margin-top: 0;
}

.bento-grid {
	display: grid;
	grid-template-columns: repeat(var(--bento-cols), minmax(0, 1fr));
	gap: var(--bento-gap);
}

.bento-card {
	position: relative;
	display: flex;
	flex-direction: column;
	grid-column: span var(--bento-span, 6);
	grid-row: span var(--bento-rows, 1);
	min-width: 0;
	min-height: var(--bento-card-min-h);
	overflow: hidden;
	border: 1px solid var(--bento-card-border);
	border-radius: var(--ii-radius-lg);
	background: var(--bento-card-bg);
	box-shadow: var(--bento-card-shadow);
	color: var(--ii-text-primary);
	text-decoration: none;
	isolation: isolate;
	transition:
		border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover,
.bento-card:focus {
	color: var(--ii-text-primary);
	text-decoration: none;
}

.bento-card:focus-visible {
	outline: 2px solid var(--ii-accent);
	outline-offset: 2px;
}

.bento-card-visual {
	position: relative;
	flex: 1 1 auto;
	min-height: 180px;
	padding-top: var(--ii-space-4);
	overflow: hidden;
	pointer-events: none;
	user-select: none;
	isolation: isolate;
}

.bento-card-visual::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		transparent var(--bento-fade-from, 62%),
		var(--bento-card-bg, var(--background)) 100%
	);
}

.bento-card-visual > * {
	transform-origin: 50% 45%;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card-body {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--ii-space-2);
	padding: 0 var(--ii-space-6) var(--ii-space-6);
}

.bento-card-title {
	margin: 0;
	font-family: var(--ii-font-display);
	font-size: var(--ii-fs-lg);
	font-weight: 600;
	line-height: var(--ii-lh-tight);
	letter-spacing: -0.3px;
	color: var(--ii-text-primary);
}

.bento-card-desc {
	margin: 0;
	max-width: 44ch;
	font-size: var(--ii-fs-sm);
	line-height: var(--ii-lh-relaxed);
	letter-spacing: -0.1px;
	color: var(--ii-text-secondary);
}

.bento-card-arrow {
	position: absolute;
	top: var(--ii-space-4);
	right: var(--ii-space-4);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--bento-line);
	border-radius: var(--ii-radius-full);
	background: var(--ii-surface-white);
	color: var(--ii-text-primary);
	opacity: 0;
	transform: translate(-4px, 4px);
	transition:
		opacity 0.3s ease,
		transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:focus-visible .bento-card-arrow {
	opacity: 1;
	transform: none;
}

@media (hover: hover) {
	.bento-card:hover {
		border-color: var(--bento-card-border-hover);
		box-shadow: var(--bento-card-shadow-hover);
	}

	.bento-card:hover .bento-card-visual > * {
		transform: scale(var(--bento-zoom-hover));
	}

	.bento-card:hover .bento-card-arrow {
		opacity: 1;
		transform: none;
	}
}

.bento-slot--empty {
	background: var(--ii-skeleton-gradient);
	background-size: 200% 100%;
}

.bento-camera {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.bento-stage {
	position: absolute;
	top: 0;
	left: 0;
	width: max-content;
	padding: 280px;
	background-image: radial-gradient(
		circle,
		var(--bento-dot) 1px,
		transparent 1.5px
	);
	background-size: 18px 18px;
	transform-origin: 0 0;
}

.bento-stage .ii-input-container {
	max-width: none;
	margin: 0;
}

.bento-scene-settings .bento-composer {
	width: 760px;
}

.bento-card-visual:has(> .bento-scene-settings) {
	--bento-fade-from: 85%;
}

.bento-scene-prompt .bento-composer {
	width: 520px;
}

.bento-stage .ii-input-row,
.bento-stage .ii-popper-menu {
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	backface-visibility: visible;
}

.bento-stage .ii-dropdown-toggle,
.bento-stage .ii-add-assets-btn,
.bento-stage .ii-send-btn,
.bento-stage .ii-popper-menu,
.bento-stage .ii-popper-menu-item {
	transition: none;
}

.bento-stage .ii-add-assets-btn,
.bento-stage .ii-dropdown-toggle {
	box-sizing: border-box;
}

.bento-card-visual:has(> .bento-scene-assets),
.bento-card-visual:has(> .bento-scene-result),
.bento-card-visual:has(> .bento-scene-finder) {
	background-image: radial-gradient(circle, var(--bento-dot) 1px, transparent 1.5px);
	background-size: 18px 18px;
}

.bento-scene-assets {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	overflow: hidden;
}

.bento-scene-assets::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		to right,
		var(--bento-card-bg, var(--background)),
		transparent 14%,
		transparent 86%,
		var(--bento-card-bg, var(--background))
	);
}

.bento-marquee-track {
	display: flex;
	flex: 0 0 auto;
	width: max-content;
	will-change: transform;
}

.bento-asset {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 0 0 auto;
	width: 148px;
	margin-right: 12px;
	padding: 8px 8px 12px;
	border: 1px solid var(--bento-line);
	border-radius: var(--ii-radius-md);
	background: var(--ii-surface-white);
	box-sizing: border-box;
}

.bento-asset-thumb {
	aspect-ratio: 1 / 1;
	margin-bottom: 6px;
	overflow: hidden;
	border-radius: var(--ii-radius-sm);
	background: var(--ii-bg-tertiary);
}

.bento-asset-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bento-asset-name {
	overflow: hidden;
	font-size: var(--ii-fs-xs);
	font-weight: 600;
	color: var(--ii-text-primary);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.bento-asset-tag {
	font-size: var(--ii-fs-2xs);
	color: var(--ii-text-tertiary);
}

.bento-toolbar {
	flex-wrap: nowrap;
}

.bento-stage .ii-custom-dropdown {
	display: inline-block;
}

.bento-stage .ii-dropdown-toggle {
	display: flex;
	width: auto;
	height: 36px;
	padding: 8px 12px;
	font-size: 13px;
	max-width: none;
}

.bento-stage .ii-dropdown-toggle.is-popper-open {
	border-color: var(--bento-line);
	background-color: var(--ii-bg-tertiary);
}

.bento-stage .ii-dropdown-icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
}

.bento-stage .ii-dropdown-icon svg {
	width: 16px;
	height: 16px;
}

.bento-stage .ii-popper-menu {
	position: absolute;
	left: 0;
	bottom: calc(100% + 8px);
	display: flex;
	min-width: 168px;
	opacity: 0;
	transform: none;
	transform-origin: bottom left;
}

.bento-stage .ii-popper-menu-item {
	z-index: 1;
	white-space: nowrap;
	cursor: default;
}

.bento-stage .ii-popper-menu-item:hover,
.bento-stage .ii-popper-menu-item.is-selected {
	background: none;
}

.bento-menu-highlight {
	position: absolute;
	top: 0;
	left: 6px;
	right: 6px;
	z-index: 0;
	border-radius: var(--ii-radius-md);
	background: var(--ii-bg-hover);
	opacity: 0;
}

.bento-stage .ii-input-row {
	padding: 12px;
	border-radius: var(--ii-radius-lgx);
}

.bento-stage .ii-input {
	max-width: 100%;
	min-height: 78px;
	max-height: none;
	padding: 8px 0;
	overflow: visible;
	font-size: 1rem;
	cursor: default;
}

.bento-scene-settings .bento-stage .ii-input {
	min-height: 0;
	color: var(--ii-text-tertiary);
	white-space: nowrap;
}

.bento-caret {
	display: inline-block;
	width: 2px;
	height: 1.15em;
	margin-left: 1px;
	vertical-align: -0.2em;
	background: var(--ii-accent);
	animation: bento-caret-blink 1s steps(1) infinite;
}

@keyframes bento-caret-blink {
	50% {
		opacity: 0;
	}
}

.bento-stage .ii-send-btn {
	gap: 6px;
	height: 36px;
	min-width: 0;
	padding: 8px 16px;
	background: var(--ii-accent);
	color: #ffffff;
	font-size: 0.875rem;
}

.bento-stage .ii-send-btn .ii-send-btn-label {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.bento-scene-result {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--ii-space-4) var(--ii-space-6) 0;
}

.bento-result-frame {
	position: relative;
	width: 100%;
	max-width: 420px;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--ii-radius-md);
}

.bento-result-img {
	position: absolute;
	inset: 0;
	z-index: 2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bento-card .ii-tool-result-skeleton-img:not(.is-dot-field),
.bento-card .ii-detector-match-card.is-skeleton .ii-detector-match-thumb {
	position: relative;
}

.bento-card .ii-tool-result-skeleton-img:not(.is-dot-field),
.bento-card .ii-detector-match-card.is-skeleton .ii-detector-match-thumb,
.bento-result-frame .ii-image-skeleton {
	overflow: hidden;
	isolation: isolate;
	background: var(--ii-skeleton-shimmer-1);
	animation: none;
}

.bento-card .ii-tool-result-skeleton-img:not(.is-dot-field)::before,
.bento-card .ii-detector-match-card.is-skeleton .ii-detector-match-thumb::before,
.bento-result-frame .ii-image-skeleton::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: -1;
	width: 400%;
	background: var(--ii-skeleton-gradient);
	background-size: 50% 100%;
	animation: bento-skeleton-sweep 0.9s linear infinite;
}

@keyframes bento-skeleton-sweep {
	from {
		transform: translateX(-50%);
	}

	to {
		transform: none;
	}
}

.bento-result-frame.bento-slot--empty {
	background: none;
}

.bento-source {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 560px;
	height: 360px;
}

.bento-stage .bento-morph {
	position: relative;
	box-sizing: border-box;
	width: auto;
	border: none;
	overflow: hidden;
	margin: 0;
	cursor: default;
	transition: none;
}

.bento-morph-label {
	white-space: nowrap;
}

.bento-morph-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
}

.bento-flow {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--bento-flow-gap, 200px);
	width: var(--bento-flow-w, 960px);
}

.bento-flow-source {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--bento-flow-source-h, 450px);
}

.bento-flow-settings {
	display: flex;
	flex-direction: column;
	gap: var(--ii-space-8);
	width: 100%;
}

.bento-flow-result .bento-compare-frame {
	width: 800px;
}

.bento-card-visual:has(> .bento-scene-flow) {
	padding-top: 0;
}

.bento-card-visual:has(> .bento-scene-flow)::after {
	content: none;
}

.bento-details .ii-tool-prompt-textarea {
	cursor: default;
}

.bento-scene-merge {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--ii-space-8);
	background-image: radial-gradient(circle, var(--bento-dot) 1px, transparent 1.5px);
	background-size: 18px 18px;
}

.bento-card-visual:has(> .bento-scene-merge) {
	padding-top: 0;
}

.bento-card-visual:has(> .bento-scene-merge)::after {
	content: none;
}

.bento-merge {
	position: relative;
	width: min(100%, 600px);
	aspect-ratio: 16 / 9;
	transform-origin: 50% 50%;
}

.bento-merge-tile {
	position: absolute;
	top: 19.333%;
	width: 46%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--ii-radius-lg);
	background: var(--ii-bg-tertiary);
	box-shadow: var(--bento-card-shadow);
}

.bento-merge-tile--source {
	left: 0;
}

.bento-merge-tile--style {
	right: 0;
}

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

.bento-merge-result {
	position: absolute;
	inset: 0;
	z-index: 2;
	overflow: hidden;
	border-radius: var(--ii-radius-lg);
	background: var(--ii-bg-tertiary);
	box-shadow: var(--bento-card-shadow);
	clip-path: inset(0 0 100% 0);
}

.bento-merge-edge {
	position: absolute;
	inset: 0;
	z-index: 3;
	overflow: hidden;
	border-radius: var(--ii-radius-lg);
	pointer-events: none;
}

.bento-merge-line {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	margin-top: -1px;
	border-radius: 2px;
	background: linear-gradient(
		90deg,
		transparent,
		#fff 18%,
		#fff 82%,
		transparent
	);
	box-shadow:
		0 0 8px 1px rgba(255, 255, 255, 0.9),
		0 0 24px 4px rgba(255, 236, 200, 0.55),
		0 0 60px 10px rgba(255, 214, 160, 0.25);
	opacity: 0;
	pointer-events: none;
	will-change: transform;
}

.bento-merge-line::before {
	content: '';
	position: absolute;
	left: 8%;
	right: 8%;
	bottom: 1px;
	height: 56px;
	background: linear-gradient(to top, rgba(255, 255, 255, 0.28), transparent);
}

.bento-scene-finder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--ii-space-4) var(--ii-space-5) var(--ii-space-2);
	container-type: size;
}

.bento-card-visual:has(> .bento-scene-finder)::after,
.bento-card-visual:has(> .bento-scene-matches)::after {
	content: none;
}

.bento-scene-finder .bento-finder-stage {
	flex: none;
	width: min(100cqw, 100cqh * var(--ii-detector-ratio, 3 / 2));
	max-width: none;
	margin: 0;
	cursor: default;
}

.bento-finder-stage .ii-detector-box {
	animation: none;
	cursor: default;
}

.bento-finder-stage .ii-detector-manual-rect {
	cursor: default;
}

.bento-cursor {
	position: absolute;
	z-index: 5;
	margin: -3px 0 0 -5px;
	transform-origin: 5px 3px;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
	pointer-events: none;
}

.bento-cursor svg {
	display: block;
}

.bento-scene-objects .ii-detector-object {
	flex: 0 0 auto;
	width: 176px;
	margin-right: 14px;
	cursor: default;
}

.bento-finder-pick {
	width: 100%;
}

.bento-stage .ii-detector-objects {
	margin-top: 0;
}

.bento-stage .ii-detector-object {
	cursor: default;
}

.bento-finder-results {
	width: 100%;
}

.bento-stage .ii-detector-match-card {
	transition: none;
}

.bento-stage .ii-detector-match-title {
	opacity: 1;
	transform: none;
}

.bento-stage .ii-detector-match-card.is-skeleton .ii-detector-match-title {
	opacity: 0;
}

.bento-render-settings {
	display: flex;
	flex-direction: column;
	gap: var(--ii-space-8);
	width: 960px;
}

.bento-stage .ii-tool-settings-row {
	grid-template-columns: repeat(
		var(--ii-tool-settings-cols, 5),
		minmax(0, 1fr)
	);
}

.bento-stage .ii-tool-dropdown {
	display: block;
}

.bento-stage .ii-tool-dropdown .ii-dropdown-toggle {
	width: 100%;
	height: 48px;
	padding: 0 var(--ii-space-4);
	gap: var(--ii-space-3);
	justify-content: flex-start;
	font-size: var(--ii-fs-sm);
}

.bento-stage .ii-tool-dropdown .ii-dropdown-icon {
	width: auto;
	height: auto;
}

.bento-stage .ii-tool-dropdown .ii-dropdown-icon svg {
	width: 18px;
	height: 18px;
}

.bento-stage .ii-tool-config-row {
	grid-template-columns: 1fr 1fr;
}

.bento-stage .ii-tool-ratio-group {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.bento-stage .ii-tool-option-card {
	cursor: default;
}

.bento-stage .ii-super-popper-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 5;
	display: flex;
	width: 450px;
	min-width: 0;
	max-width: none;
	opacity: 0;
	transform: none;
	transform-origin: top left;
	backface-visibility: visible;
	transition: none;
}

.bento-stage .ii-super-popper-menu.is-end {
	right: 0;
	left: auto;
	transform-origin: top right;
}

.bento-stage .ii-super-popper-items-list {
	max-height: none;
	overflow: visible;
}

.bento-stage .ii-super-popper-item,
.bento-stage .ii-super-popper-thumb {
	cursor: default;
	transition: none;
}

.bento-stage .ii-super-popper-search-input {
	color: var(--ii-text-tertiary);
}

.bento-scene-compare {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--ii-space-6);
	background-image: radial-gradient(
		circle,
		var(--bento-dot) 1px,
		transparent 1.5px
	);
	background-size: 18px 18px;
}

.bento-card-visual:has(> .bento-scene-compare)::after {
	content: none;
}

.bento-compare-frame {
	position: relative;
	width: min(100%, 640px);
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--ii-radius-lg);
	background: var(--ii-bg-tertiary);
	box-shadow: var(--bento-card-shadow);
}

.bento-compare-frame .bento-compare-skeleton,
.bento-compare-frame .bento-compare {
	position: absolute;
	inset: 0;
	width: auto;
	max-width: none;
	margin: 0;
	border-radius: inherit;
}

.bento-compare-skeleton .ii-tool-result-skeleton-img {
	height: 100%;
	aspect-ratio: auto;
}

.bento-compare {
	background: transparent;
}

.bento-compare .ii-tool-compare-stage {
	width: 100%;
	height: 100%;
	cursor: default;
}

.bento-compare .ii-tool-compare-img--after {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
}

.bento-compare .ii-tool-compare-handle {
	cursor: default;
}

@media (max-width: 1024px) {
	.bento-card {
		grid-column: span var(--bento-span-md, var(--bento-span, 6));
	}

	.bento-split {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--ii-home-rows-gap);
	}

	.bento-split .bento-head {
		align-items: center;
		max-width: 880px;
		margin: 0 auto;
		text-align: center;
	}

	.bento-split .bento-head-actions {
		justify-content: center;
	}
}

@media (max-width: 768px) {
	.bento-card {
		grid-column: 1 / -1;
		grid-row: auto;
	}

	.bento-card:has(.bento-scene-compare) {
		min-height: 380px;
	}

	.bento-card:has(.bento-scene-flow) {
		min-height: 440px;
	}

	.bento-scene-compare {
		padding: var(--ii-space-4);
	}

	.bento-head .bento-head-title {
		font-size: var(--ii-fs-4xl);
	}

	.bento-head .bento-head-desc {
		font-size: var(--ii-fs-md);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.bento-reveal {
		opacity: 0;
		animation: bento-reveal-failsafe 0.4s ease 4s forwards;
	}
}

@keyframes bento-reveal-failsafe {
	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bento-card,
	.bento-card-arrow,
	.bento-card-visual > * {
		transition: none;
	}

	.bento-caret {
		display: none;
	}

	.bento-result-frame .ii-image-skeleton::before,
	.bento-card .ii-tool-result-skeleton-img::before,
	.bento-card .ii-detector-match-thumb::before {
		animation: none;
	}

	.bento-head-cta svg {
		transition: none;
	}
}
