.lens-demo {
	color: var(--foreground);
	font-family: var(--font-sans, sans-serif);
	font-size: 14px;
	line-height: 1.5;
	min-width: 0;
}
.lens-demo .lens-heading {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 20px;
	padding: 16px;
	border-bottom: 1px solid var(--border);
}
.lens-demo .lens-heading strong {
	font-weight: 600;
}
.lens-demo .lens-muted {
	color: var(--muted-foreground);
}
.lens-demo .lens-scene {
	position: relative;
	height: 420px;
	background: radial-gradient(ellipse at center, #123e3d 0%, #061e20 72%);
	cursor: grab;
}
.lens-demo .lens-orientation {
	position: absolute;
	left: 12px;
	bottom: 10px;
	padding: 4px 8px;
	border-radius: 6px;
	background: #061e20e6;
	color: #dce9e7;
	font-size: 12px;
	pointer-events: none;
}
.lens-demo .lens-scene canvas {
	display: block;
	touch-action: pan-y !important;
}
.lens-demo .lens-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 20px;
	padding: 12px 16px;
	background: #061e20;
	color: #dce9e7;
	font-size: 12px;
}
.lens-demo .lens-key::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 6px;
	background: var(--key-color);
}
.lens-demo .lens-controls {
	display: grid;
	gap: 12px;
	padding: 16px;
	border-top: 1px solid var(--border);
}
.lens-demo label {
	display: grid;
	gap: 4px;
	min-width: 0;
}
.lens-demo select {
	width: 100%;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: #163935;
	color: #edf4f2;
	font: inherit;
}
.lens-demo select:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 3px;
}
.lens-demo .lens-display-options summary {
	min-height: 44px;
	padding: 10px 0;
	cursor: pointer;
}
.lens-demo .lens-options {
	display: grid;
	gap: 8px;
}
.lens-demo .lens-options label:has(input[type="checkbox"]) {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	cursor: pointer;
}
.lens-demo input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--primary);
}
.lens-demo .lens-value {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 4px 12px;
}
.lens-demo output {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}
.lens-demo input[type="range"] {
	width: 100%;
	height: 44px;
	margin: 0;
	accent-color: var(--primary);
	cursor: pointer;
}
.lens-demo .lens-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.lens-demo .lens-camera-views summary {
	min-height: 44px;
	padding: 10px 0;
	cursor: pointer;
}
.lens-demo .lens-camera-views .lens-note {
	margin-top: 8px;
}
.lens-demo summary:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 3px;
}
.lens-demo button {
	min-height: 44px;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #455a64;
	color: #f5f7f7;
	cursor: pointer;
}
.lens-demo button[aria-pressed="true"] {
	background: var(--primary);
	color: var(--primary-foreground);
}
.lens-demo button:focus-visible,
.lens-demo input:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 3px;
}
.lens-demo .lens-note {
	margin: 0;
	font-size: 12px;
	color: var(--muted-foreground);
}
.lens-demo .lens-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	padding: 16px;
}
.lens-demo .lens-stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	font-size: 12px;
	color: var(--muted-foreground);
}
.lens-demo .lens-stat strong {
	font-size: 22px;
	color: var(--foreground);
	font-variant-numeric: tabular-nums;
}
.lens-demo .lens-rays {
	display: block;
	width: 100%;
	height: auto;
	background: #061e20;
}
@media (max-width: 767px) {
	.lens-demo .lens-scene {
		height: auto;
		aspect-ratio: 1;
		max-height: 380px;
	}
	.lens-demo .lens-heading,
	.lens-demo .lens-controls,
	.lens-demo .lens-stats {
		padding: 12px;
	}
}

.lens-options {
	width: 100%;
	font-size: 13px;
}
.lens-options > summary {
	cursor: pointer;
	color: var(--muted-foreground);
	padding: 4px 0;
}
.lens-options[open] > summary {
	margin-bottom: 12px;
}
.lens-options > label {
	display: block;
	margin-bottom: 12px;
}

.lens-animated-scene { position: relative; }
.lens-focus-cue { position: absolute; inset: 0; pointer-events: none; --near-blur: 2.5px; --far-blur: 0px; }
.lens-focus-picture { position: absolute; top: .8rem; left: .8rem; width: 110px; color: #b1c5c3; font-size: .65rem; }
.lens-focus-picture svg { display: block; width: 100%; overflow: visible; }
.focus-far { filter: blur(var(--far-blur)); }
.focus-near { filter: blur(var(--near-blur)); }
.lens-focus-readout { position: absolute; right: 1rem; bottom: 1rem; display: grid; justify-items: end; gap: .2rem; font-size: .65rem; color: #b1c5c3; }
.lens-focus-readout output { font-size: 1.15rem; color: #dce9e7; font-variant-numeric: tabular-nums; }
.lens-demo .lens-motion-pause { pointer-events: auto; padding: .25rem 0; background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; }
.lens-demo .lens-map-divider { position: absolute; top: 0; bottom: 0; width: 44px; padding: 0; transform: translateX(-50%); border: 0; border-radius: 0; background: transparent; cursor: ew-resize; touch-action: none; }
.lens-demo .lens-map-divider::before { content: ''; position: absolute; top: 5.5rem; bottom: 4rem; left: 50%; width: 1px; background: #90aaa880; pointer-events: none; }
.lens-demo .lens-map-divider > span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #092a2a; border: 1px solid #90aaa8; width: 28px; height: 28px; display: grid; place-items: center; color: #dce9e7; font-size: 15px; }
.lens-demo .lens-map-divider:focus-visible { outline: 1px solid var(--primary); outline-offset: -2px; }
.lens-animation-note { padding: 0 1rem 1rem; }
@media (prefers-reduced-motion: reduce) { .lens-demo .lens-motion-pause { display: none; } }
.lens-focus-readout { z-index: 3; }

.lens-demo .lens-motion-pause[aria-pressed] { background: transparent; color: #dce9e7; border: 0; border-radius: 0; }

.lens-animation-footer { display: flex; justify-content: flex-end; padding: 0 1rem; background: #061e20; }
.lens-comparison-labels { position: absolute; inset: .75rem 1rem auto; display: flex; justify-content: space-between; pointer-events: none; font-size: .7rem; color: #b1c5c3; }
.lens-surface-comparison .lens-map-divider::before { top: 2rem; bottom: 1rem; }
.lens-demo .lens-map-divider:focus-visible { outline: none; }
.lens-demo .lens-map-divider:focus-visible > span { outline: 2px solid var(--primary); outline-offset: 2px; }
.lens-demo .lens-cataract-scene { width: 100%; height: 620px; max-height: none; aspect-ratio: auto; }
.lens-cataract-labels { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); pointer-events: none; color: #dce9e7; font-size: .8rem; text-align: center; }
.lens-cataract-labels > span { padding: .8rem .4rem; }
@media (max-width: 540px) { .lens-demo .lens-cataract-scene { height: 500px; } }

/* Discrete focus states remain available without automatic motion. */
.lens-demo .lens-static-focus { display: none; pointer-events: auto; padding: .25rem 0; background: transparent; color: #dce9e7; border: 0; border-radius: 0; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .lens-demo .lens-static-focus { display: inline-block; }
}