/* image-viewer.css - Full-screen custom image viewer. Uses --ii-* tokens from variables.css. */

/* Backdrop */
.ii-viewer-backdrop {
	position: fixed;
	inset: 0;
	background: var(--ii-viewer-backdrop-bg);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 9990;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
	display: none;
}

.ii-viewer-backdrop.is-open {
	opacity: 1;
	pointer-events: all;
}

/* Main container */
.ii-viewer-container {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -45%) scale(0.95);
	z-index: 9991;
	opacity: 0;
	pointer-events: none;
	transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

	display: flex;
	width: 92vw;
	max-width: 1360px;
	height: 90svh;
	max-height: 900px;
	border-radius: var(--ii-radius-rounded);
	overflow: hidden;
	background: var(--ii-viewer-bg);
	box-shadow: var(--ii-viewer-shadow);
}

.ii-viewer-container.is-open {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
	pointer-events: all;
}

/* LEFT - Image stage */
.ii-viewer-left {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--ii-viewer-bg);
	position: relative;
	overflow: hidden;
}

/* Stage: clipping area for pan/zoom */
.ii-viewer-stage {
	flex: 1;
	min-height: 0;
	position: relative;
	overflow: hidden;
	cursor: grab;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	user-select: none;
	/* Let JS own all touch events: prevents browser pinch-zoom / scroll */
	touch-action: none;
}

.ii-viewer-stage.is-dragging {
	cursor: grabbing;
}

.ii-viewer-stage.is-fit {
	cursor: default;
}

/* Image inside stage */
.ii-viewer-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	transform-origin: center center;
	transition:
		transform 0.22s ease,
		opacity 0.22s ease;
	/* will-change is toggled in JS (_applyTransform) only while panning/zooming
	   is active - a permanently-promoted layer left the image looking slightly
	   soft even at rest. */
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

.ii-viewer-img.is-transitioning {
	opacity: 0;
}

.ii-viewer-stage.is-dragging .ii-viewer-img {
	transition: none;
}

/* Loading skeleton inside stage */
.ii-viewer-img-skeleton {
	position: absolute;
	inset: 20px;
	border-radius: 8px;
	background: var(--ii-viewer-skeleton-base);
	background-size: 200% 100%;
	animation: iiSkeletonShimmer 1.8s infinite linear;
	display: none;
}

.ii-viewer-img-skeleton.is-visible {
	display: block;
}

/* Zoom controls bar (bottom of left panel) */
.ii-viewer-zoom-bar {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	background: var(--ii-viewer-bg);
	border-top: 1px solid var(--ii-viewer-border);
}

.ii-viewer-zoom-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	border: 1px solid var(--ii-viewer-control-border);
	background: var(--ii-viewer-control-bg);
	color: var(--ii-viewer-control-text);
	cursor: pointer;
	flex-shrink: 0;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}

.ii-viewer-zoom-btn:hover {
	background: var(--ii-viewer-control-hover-bg);
	color: var(--ii-viewer-control-hover-text);
}

.ii-viewer-zoom-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.ii-viewer-zoom-btn svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* Range track */
.ii-viewer-zoom-range {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	height: 3px;
	border-radius: 2px;
	background: var(--ii-viewer-zoom-track);
	outline: none;
	cursor: pointer;
	accent-color: var(--ii-accent, #2563eb);
}

.ii-viewer-zoom-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--ii-accent, #2563eb);
	cursor: pointer;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
	transition: transform 0.15s ease;
}

.ii-viewer-zoom-range::-webkit-slider-thumb:hover {
	transform: scale(1.2);
}

.ii-viewer-zoom-range::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--ii-accent, #2563eb);
	border: none;
	cursor: pointer;
}

.ii-viewer-zoom-pct {
	font-size: 11px;
	font-weight: 600;
	color: var(--ii-viewer-zoom-pct-color);
	letter-spacing: 0.04em;
	min-width: 36px;
	text-align: right;
	flex-shrink: 0;
}

.ii-viewer-zoom-reset {
	font-size: 12px;
	font-weight: 500;
	color: var(--ii-viewer-zoom-reset-color);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 4px;
	letter-spacing: normal;
	text-transform: none;
	transition: color 0.15s ease;
	flex-shrink: 0;
}

.ii-viewer-zoom-reset:hover {
	color: var(--ii-viewer-zoom-reset-hover-color);
}

/* Variant thumbnail strip */
.ii-viewer-variants {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	background: var(--ii-viewer-bg);
	border-top: 1px solid var(--ii-viewer-border);
	overflow-x: auto;
	overflow-y: hidden;
	max-height: 120px;
	transition:
		max-height 0.22s ease,
		opacity 0.18s ease,
		padding-top 0.22s ease,
		padding-bottom 0.22s ease;
}

@supports (-moz-appearance: none) {
	.ii-viewer-variants {
		scrollbar-width: thin;
		scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
	}
}

.ii-viewer-variants.is-hidden {
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	opacity: 0;
	pointer-events: none;
}

.ii-viewer-variant-thumb {
	width: 56px;
	height: 56px;
	border-radius: 7px;
	object-fit: cover;
	flex-shrink: 0;
	cursor: pointer;
	border: 2px solid transparent;
	transition:
		border-color 0.18s ease,
		opacity 0.18s ease,
		transform 0.18s ease;
	opacity: 0.6;
	background: var(--ii-viewer-control-bg);
}

.ii-viewer-variant-thumb:hover {
	opacity: 0.85;
	transform: scale(1.05);
}

.ii-viewer-variant-thumb.is-active {
	border-color: var(--ii-accent, #2563eb);
	opacity: 1;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.ii-viewer-variant-label {
	font-size: 9px;
	font-weight: 700;
	color: var(--ii-viewer-control-text);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	margin-top: 4px;
}

.ii-viewer-variant-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	flex-shrink: 0;
}

/* RIGHT - Metadata sidebar */
.ii-viewer-sidebar {
	width: 300px;
	flex-shrink: 0;
	background: var(--ii-viewer-sidebar-bg);
	border-left: 1px solid var(--ii-viewer-border);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ii-viewer-sidebar-inner {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

@supports (-moz-appearance: none) {
	.ii-viewer-sidebar-inner {
		scrollbar-width: thin;
		scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
	}
}

/* Sidebar section: Date */
.ii-viewer-meta-date {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--ii-viewer-text-secondary);
	font-weight: 500;
}

.ii-viewer-meta-date svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	color: var(--ii-viewer-text-faint);
}

/* Sidebar section: image actions */
.ii-viewer-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.ii-viewer-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 8px;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid var(--ii-viewer-control-border);
	background: var(--ii-viewer-control-bg);
	color: var(--ii-viewer-control-text);
	text-decoration: none;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}

.ii-viewer-action-btn svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.ii-viewer-action-btn:hover {
	background: var(--ii-viewer-control-hover-bg);
	border-color: var(--ii-viewer-control-hover-border);
	color: var(--ii-viewer-control-hover-text);
}

.ii-viewer-action-btn.is-done {
	color: #10b981;
	border-color: rgba(16, 185, 129, 0.5);
	background: rgba(16, 185, 129, 0.08);
}

/* Sidebar section: prompt */
.ii-viewer-prompt-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ii-viewer-actions-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ii-viewer-section-label {
	font-size: 12px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: normal;
	color: var(--ii-viewer-text-faint);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.ii-viewer-section-label-actions {
	display: flex;
	align-items: center;
	gap: 2px;
}

.ii-viewer-icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 6px;
	background: transparent;
	border: none;
	color: var(--ii-viewer-text-faint);
	cursor: pointer;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}

.ii-viewer-icon-btn svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

.ii-viewer-icon-btn:hover {
	background: var(--ii-viewer-control-hover-bg);
	color: var(--ii-viewer-control-hover-text);
}

.ii-viewer-icon-btn.is-hidden {
	display: none;
}

.ii-viewer-prompt-text-wrap {
	position: relative;
}

.ii-viewer-prompt-text {
	font-size: 13px;
	line-height: 1.6;
	color: var(--ii-viewer-text-primary);
	margin: 0;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
}

.ii-viewer-prompt-text.is-expanded {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: unset;
}

/* Pills inline within viewer prompt text */
.ii-viewer-prompt-text .ii-mention-pill {
	white-space: nowrap;
	vertical-align: middle;
	position: relative;
	top: -1px;
}

.ii-viewer-prompt-show-all {
	display: none;
	margin-top: 4px;
	font-size: 11px;
	font-weight: 600;
	color: var(--ii-accent);
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-family: var(--ii-font-body, Inter, sans-serif);
}

.ii-viewer-prompt-show-all.is-visible {
	display: inline-block;
}

/* Sidebar section: settings badges */
.ii-viewer-settings {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ii-viewer-badge-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ii-viewer-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border-radius: 9999px;
	background: var(--ii-viewer-badge-bg);
	border: 1px solid var(--ii-viewer-badge-border);
	font-size: 11px;
	font-weight: 500;
	color: var(--ii-viewer-badge-text);
	font-family: var(--ii-font-body, Inter, sans-serif);
}

/* Sidebar loading skeleton */
.ii-viewer-sidebar-skeleton {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
}

.ii-viewer-skel-line {
	height: 12px;
	border-radius: 6px;
	background: var(--ii-viewer-sidebar-skeleton-base);
	background-size: 200% 100%;
	animation: iiSkeletonShimmer 1.8s infinite linear;
}

.ii-viewer-sidebar.is-loading .ii-viewer-sidebar-inner {
	display: none;
}

.ii-viewer-sidebar.is-loading .ii-viewer-sidebar-skeleton {
	display: flex;
}

.ii-viewer-sidebar:not(.is-loading) .ii-viewer-sidebar-skeleton {
	display: none;
}

/* Sidebar header row (date + close button) */
.ii-viewer-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-shrink: 0;
}

/* Close button (inside sidebar header) */
.ii-viewer-close {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	border: 1px solid var(--ii-viewer-control-border);
	background: var(--ii-viewer-control-bg);
	color: var(--ii-viewer-control-text);
	cursor: pointer;
	transition:
		background 0.15s ease,
		color 0.15s ease;
}

.ii-viewer-close:hover {
	background: var(--ii-viewer-control-hover-bg);
	color: var(--ii-viewer-control-hover-text);
}

.ii-viewer-close svg {
	width: 14px;
	height: 14px;
}

.ii-viewer-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	border-radius: var(--ii-radius-rounded);
	border: 1px solid var(--ii-viewer-nav-border);
	background: var(--ii-viewer-nav-bg);
	color: var(--ii-viewer-nav-color);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 5;
	transition:
		background 0.15s ease,
		color 0.15s ease,
		opacity 0.15s ease;
	backdrop-filter: blur(4px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.ii-viewer-nav:hover {
	background: var(--ii-viewer-nav-hover-bg);
	color: var(--ii-viewer-nav-color-hover);
}

.ii-viewer-nav:disabled,
.ii-viewer-nav[disabled] {
	opacity: 0.2;
	cursor: not-allowed;
	pointer-events: none;
}

.ii-viewer-nav svg {
	width: 16px;
	height: 16px;
}

.ii-viewer-nav-prev {
	left: 14px;
}

.ii-viewer-nav-next {
	/* Keep away from the sidebar border */
	right: 14px;
}

/* Responsive */
@media (max-width: 900px) {
	.ii-viewer-container {
		flex-direction: column;
		width: 100vw;
		height: 100svh;
		max-height: 100svh;
		border-radius: 0;
		max-width: 100%;
	}

	.ii-viewer-sidebar {
		width: 100%;
		flex-shrink: 0;
		max-height: 40svh;
		border-left: none;
		border-top: 1px solid var(--ii-border, #e5e7eb);
	}

	.ii-viewer-nav-next {
		right: 14px;
	}
}

.ii-viewer-sidebar .ii-viewer-variants {
	/* Reset any bottom-strip overrides */
	position: static;
	bottom: auto;
	left: auto;
	right: auto;
	width: auto;

	/* 3-per-row wrapping grid */
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;

	/* Spacing inside sidebar */
	padding: 10px 12px;
	overflow: visible;
	overflow-x: unset;

	/* Separator above the variant grid */
	border-top: 1px solid var(--ii-card-border, rgba(255, 255, 255, 0.1));
	margin-top: 8px;
}

/* Individual variant thumbnail */
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb {
	/* Reset any bottom-strip sizing */
	width: 100%;
	height: auto;
	flex: none;
	flex-shrink: unset;

	aspect-ratio: 1 / 1;
	border-radius: var(--ii-radius-sm, 8px);
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	transition:
		border-color 160ms ease,
		transform 160ms ease,
		opacity 160ms ease;
	opacity: 0.65;
	position: relative;
}

.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb:hover {
	opacity: 0.88;
	transform: scale(1.04);
}

.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb.is-active,
.ii-viewer-sidebar
	.ii-viewer-variants
	.ii-viewer-variant-thumb[data-active='true'],
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb.active {
	border-color: var(--ii-accent, #7c5ef1);
	opacity: 1;
	transform: none;
}

/* The <img> tag inside each thumb */
.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb img,
.ii-viewer-sidebar
	.ii-viewer-variants
	.ii-viewer-variant-thumb
	.ii-variant-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	pointer-events: none;
}

/* Variant label (V1, V2 …) optional */
.ii-viewer-sidebar .ii-viewer-variants .ii-variant-label {
	position: absolute;
	bottom: 3px;
	left: 4px;
	font-size: 9px;
	font-weight: 700;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
	pointer-events: none;
	line-height: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb {
		transition: none;
	}

	.ii-viewer-sidebar .ii-viewer-variants .ii-viewer-variant-thumb:hover {
		transform: none;
	}
}

/* Dark theme adjustments */
[data-theme='dark'] .ii-viewer-sidebar .ii-viewer-variants {
	border-top-color: rgba(255, 255, 255, 0.08);
}

/* Light theme adjustments */
[data-theme='light'] .ii-viewer-sidebar .ii-viewer-variants {
	border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme='light']
	.ii-viewer-sidebar
	.ii-viewer-variants
	.ii-viewer-variant-thumb {
	opacity: 0.72;
}

[data-theme='light']
	.ii-viewer-sidebar
	.ii-viewer-variants
	.ii-viewer-variant-thumb:hover {
	opacity: 0.9;
}

[data-theme='light']
	.ii-viewer-sidebar
	.ii-viewer-variants
	.ii-viewer-variant-thumb.is-active {
	opacity: 1;
}

.ii-viewer-used-assets {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ii-viewer-used-assets.is-hidden {
	display: none;
}

.ii-viewer-asset-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
}

/* Each asset is an <a> linking to zeelproject.com */
.ii-viewer-asset-item {
	display: flex;
	align-items: center;
	position: relative;
	flex-direction: column;
	width: 100%;
	gap: 3px;
	border-radius: 9px;
	border: 1px solid var(--ii-viewer-border);
	background: var(--ii-viewer-control-bg);
	text-decoration: none;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease;
}

.ii-viewer-asset-item:hover {
	background: var(--ii-viewer-control-hover-bg);
	border-color: var(--ii-viewer-control-hover-border);
}

.ii-viewer-asset-item.is-custom {
	cursor: default;
}

.ii-viewer-asset-thumb {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--ii-viewer-control-bg);
}

.ii-viewer-asset-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

/* Darkening overlay on hover - surfaces the centered view button */
.ii-viewer-asset-item .ii-viewer-asset-thumb::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0);
	transition: background 0.18s ease;
	pointer-events: none;
}

.ii-viewer-asset-item:hover .ii-viewer-asset-thumb::after {
	background: rgba(0, 0, 0, 0.25);
}

[data-theme='dark'] .ii-viewer-asset-item:hover .ii-viewer-asset-thumb::after {
	background: rgba(0, 0, 0, 0.45);
}

/* Centered "view in modal" button */
.ii-viewer-asset-item .ii-asset-view-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.85);
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	cursor: pointer;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	opacity: 0;
	z-index: 5;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	transition:
		opacity 0.18s ease,
		transform 0.18s ease,
		background 0.15s ease;
}

.ii-viewer-asset-item:hover .ii-asset-view-btn {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.ii-viewer-asset-item .ii-asset-view-btn:hover {
	background: rgba(0, 0, 0, 0.8);
}

.ii-viewer-asset-item .ii-asset-view-btn svg {
	width: 16px;
	height: 16px;
}

/* Three-dots options button - top-right corner */
.ii-viewer-asset-item .ii-asset-options-btn {
	position: absolute;
	top: 2px;
	right: 2px;
	z-index: 6;
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	cursor: pointer;
	border-radius: var(--ii-radius-rounded, 999px);
	background: rgba(0, 0, 0, 0.48);
	color: #fff;
	opacity: 0;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition:
		background 0.15s ease,
		opacity 0.15s ease;
}

.ii-viewer-asset-item:hover .ii-asset-options-btn,
.ii-viewer-asset-item .ii-asset-options-btn.is-popper-open {
	opacity: 1;
}

.ii-viewer-asset-item .ii-asset-options-btn:hover {
	background: rgba(0, 0, 0, 0.72);
}

/* Author card */
.ii-viewer-author {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ii-viewer-author-card {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ii-viewer-author-card-external {
	margin-left: auto;
	flex-shrink: 0;
	color: var(--ii-text-tertiary);
	display: flex;
	align-items: center;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.15s ease,
		visibility 0.15s ease;
}

.ii-viewer-author-card:hover .ii-viewer-author-card-external {
	opacity: 1;
	visibility: visible;
}

.ii-viewer-author-card-external svg {
	width: 16px;
	height: 16px;
}

.ii-viewer-author-avatar-wrap {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 100px;
	overflow: hidden;
	background: var(--ii-viewer-author-avatar-bg);
	border: 1px solid var(--ii-viewer-author-avatar-border);
}

.ii-viewer-author-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* SVG fallback icon — hidden by default, shown when wrap has .has-fallback */
.ii-viewer-author-avatar-icon {
	display: none;
	color: var(--ii-viewer-author-avatar-icon);
	pointer-events: none;
}

/* Fallback state: hide img, show SVG icon centred in the wrap */
.ii-viewer-author-avatar-wrap.has-fallback .ii-viewer-author-avatar {
	display: none;
}

.ii-viewer-author-avatar-wrap.has-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ii-viewer-author-avatar-wrap.has-fallback .ii-viewer-author-avatar-icon {
	display: block;
}

.ii-viewer-author-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ii-viewer-author-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--ii-viewer-text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.3;
}

.ii-viewer-author-username {
	font-size: 11px;
	color: var(--ii-viewer-text-secondary);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ii-viewer-author-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.ii-viewer-author-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 28px;
	padding: 0 11px;
	border-radius: 7px;
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	line-height: 1;
	transition:
		background 0.18s ease,
		color 0.18s ease,
		border-color 0.18s ease;
	border: 1px solid var(--ii-viewer-author-btn-border);
	color: var(--ii-viewer-author-btn-text);
	background: var(--ii-viewer-author-btn-bg);
}

.ii-viewer-author-workspace-btn {
	background: rgba(59, 130, 246, 0.1);
	border-color: rgba(59, 130, 246, 0.28);
	color: var(--ii-viewer-workspace-btn-text);
}

.ii-viewer-author-workspace-btn:hover {
	background: rgba(59, 130, 246, 0.18);
	border-color: rgba(59, 130, 246, 0.5);
	color: var(--ii-viewer-workspace-btn-hover-text);
}
