/* gmailtheme — attachment viewer (js/lightbox.js): a window like the maximized composer over the dimmed page. */

html.gm-lb-open { overflow: hidden; }

.gm-lb {
	position: fixed;
	inset: 0;
	z-index: 9990; /* under Nextcloud dialogs (9998), so "Save to Files" can open its folder picker on top */
	color: var(--gm-text, #1d2228);
	font-family: var(--gm-font, sans-serif);
	outline: none;
}
.gm-lb [hidden] { display: none !important; }
/* the dimmed page around the window (the maximized composer's colour) */
.gm-lb-dim { position: absolute; inset: 0; background: rgba(32, 33, 36, .55); }
/* the window: same box as the maximized New message composer (gmail.css .floating-composer--maximized) */
.gm-lb-win {
	position: absolute;
	left: 50%;
	bottom: 40px;
	width: min(1300px, calc(100vw - 80px));
	height: calc(100vh - 80px);
	transform: translateX(-50%);
	border-radius: 20px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12), 0 5px 5px -3px rgba(0, 0, 0, .2);
}

.gm-lb .gm-ic { width: 20px; height: 20px; }
.gm-lb .gm-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 40px;
	min-height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--gm-text-2, #464e56);
	cursor: pointer;
}
.gm-lb .gm-btn:hover { background: rgba(68, 71, 70, .08); color: var(--gm-text, #1d2228); }
.gm-lb .gm-btn:active { background: rgba(68, 71, 70, .14); }

/* header bar (like the composer's) */
.gm-lb-bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2;
	height: 56px;
	box-sizing: border-box;
	padding: 0 10px 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	background: #fff;
	border-bottom: 1px solid var(--y-line, #f0f3f5);
}
.gm-lb-left, .gm-lb-right { display: flex; align-items: center; min-width: 0; }
.gm-lb-left { gap: 12px; flex: 1 1 auto; }
.gm-lb-right { gap: 2px; flex: none; }
/* button groups: a separator before each visible group that follows a visible one */
.gm-lb-grp { display: flex; align-items: center; gap: 2px; }
.gm-lb-grp:not([hidden]) ~ .gm-lb-grp:not([hidden])::before {
	content: "";
	flex: none;
	width: 1px;
	height: 20px;
	margin: 0 6px;
	background: var(--gm-line, rgba(0, 0, 0, .12));
}
.gm-lb-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 6px;
	color: #fff;
}
.gm-lb-badge .gm-ic { width: 16px; height: 16px; }
.gm-lb-badge.is-pdf { background: #ea4335; }
.gm-lb-badge.is-img { background: var(--y-purple, #7d2eff); }
.gm-lb-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 600;
	color: var(--gm-text, #1d2228);
}

/* stage: the pdf.js iframe or the image, on a light grey page like a document viewer */
.gm-lb-stage {
	position: absolute;
	inset: 56px 0 0 0;
	z-index: 1;
	background: #f1f2f4;
}
.gm-lb-frame {
	position: relative;
	z-index: 1; /* over the placeholder page */
	transition: opacity .15s ease;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: transparent;
	color-scheme: light;
}
.gm-lb-imgwrap {
	position: absolute;
	inset: 0;
	overflow: auto;
	display: flex;
	padding: 16px 16px 88px;
	box-sizing: border-box;
}
.gm-lb-img {
	margin: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 4px 12px rgba(0, 0, 0, .12);
	background: #fff;
	user-select: none;
}
.gm-lb-img.is-zoomed { max-width: none; max-height: none; height: auto; }

/* bottom pill: page counter + zoom */
.gm-lb-pill {
	position: absolute;
	left: 50%;
	bottom: 20px;
	z-index: 2;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 2px;
	height: 48px;
	padding: 0 4px;
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 4px 14px rgba(0, 0, 0, .12);
	white-space: nowrap;
}
.gm-lb-page { padding: 0 12px 0 16px; font-size: 13.5px; color: var(--gm-text-2, #464e56); font-variant-numeric: tabular-nums; }
.gm-lb-sep { width: 1px; height: 24px; margin: 0 4px; background: var(--gm-line, rgba(0, 0, 0, .12)); }
.gm-lb-pill .gm-btn[data-tip]:hover::after { top: auto; bottom: calc(100% + 10px); }

/* prev / next attachment */
.gm-lb .gm-lb-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 44px;
	transform: translateY(-50%);
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 4px 14px rgba(0, 0, 0, .12);
}
.gm-lb .gm-lb-nav:hover { background: var(--y-purple-light, #f1e9ff); color: var(--y-purple, #7d2eff); }
.gm-lb-prev { left: 16px; }
.gm-lb-next { right: 16px; }
.gm-lb-nav[data-tip]:hover::after { display: none; }

/* find box */
.gm-lb-find {
	position: absolute;
	top: 64px;
	right: 16px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 2px;
	height: 48px;
	padding: 0 4px 0 12px;
	border-radius: 12px;
	background: #fff;
	color: #3c4043;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 4px 14px rgba(0, 0, 0, .14);
}
.gm-lb-find > .gm-ic { width: 20px; height: 20px; color: #5f6368; }
.gm-lb-find input {
	width: 200px;
	height: 36px;
	margin: 0 0 0 8px;
	padding: 0;
	border: 0 !important;
	outline: none;
	box-shadow: none !important;
	background: transparent !important;
	color: #202124;
	font: 400 15px var(--gm-font-text, sans-serif);
}
.gm-lb-find-count { min-width: 52px; padding: 0 8px; font-size: 13px; color: #5f6368; text-align: right; font-variant-numeric: tabular-nums; }
.gm-lb-find .gm-btn { color: #5f6368; }
.gm-lb-find .gm-btn:hover { background: rgba(60, 64, 67, .08); }
.gm-lb-find .gm-ic { width: 20px; height: 20px; }

/* more menu */
.gm-lb-menu {
	position: fixed;
	z-index: 4;
	min-width: 240px;
	padding: 8px 0;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 2px 6px 2px rgba(60, 64, 67, .15), 0 1px 2px rgba(60, 64, 67, .3);
}
.gm-lb .gm-lb-menu-item {
	display: flex !important;
	align-items: center;
	gap: 16px;
	width: 100% !important;
	height: 40px;
	min-height: 40px;
	margin: 0 !important;
	padding: 0 24px 0 16px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: #202124 !important;
	justify-content: flex-start;
	font: 400 14px var(--gm-font-text, sans-serif);
	text-align: left;
	cursor: pointer;
}
.gm-lb .gm-lb-menu-item:hover { background: rgba(60, 64, 67, .08) !important; }
.gm-lb-menu-item .gm-ic { width: 20px; height: 20px; color: #5f6368; }

/* loading / error */
/* placeholder while the window grows out (js: nothing loads until it's open) and until pdf.js has laid out the
   pages / the image has loaded: a static grey file icon, nothing animated (Navin 2026-11-09) */
.gm-lb-frame.is-wait { opacity: 0; pointer-events: none; }
.gm-lb-ph {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.gm-lb-ph .gm-ic { width: 128px; height: 128px; color: #c3c6cb; }
/* the kept pdf.js frame waits here while the lightbox is closed (js/lightbox.js viewer()) */
.gm-lb-park { display: none; }
.gm-lb-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 4px solid color-mix(in srgb, var(--y-purple, #7d2eff) 18%, #fff);
	border-top-color: var(--y-purple, #7d2eff);
	border-radius: 50%;
	animation: gm-lb-spin .8s linear infinite;
	pointer-events: none;
}
@keyframes gm-lb-spin { to { transform: rotate(360deg); } }
.gm-lb-error {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 24px 32px;
	border-radius: 16px;
	background: #fff;
	color: var(--gm-text, #1d2228);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 4px 14px rgba(0, 0, 0, .12);
	font-size: 15px;
	text-align: center;
}
.gm-lb-errbtn {
	height: 36px;
	padding: 0 20px;
	border: 0;
	border-radius: 18px;
	background: var(--y-purple, #7d2eff);
	color: #fff;
	font: 500 14px var(--gm-font, sans-serif);
	cursor: pointer;
}

/* phones */
@media (max-width: 640px) {
	.gm-lb-win { width: 100vw; height: calc(100% - 24px); bottom: 0; border-radius: 16px 16px 0 0; }
	.gm-lb-bar { padding: 0 4px; gap: 4px; }
	.gm-lb-left { gap: 8px; }
	.gm-lb-right { gap: 0; }
	.gm-lb [data-tip]:hover::after { display: none; }
	.gm-lb .gm-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
	.gm-lb-badge { display: none; }
	.gm-lb-find { left: 8px; right: 8px; }
	.gm-lb-find input { flex: 1; width: auto; min-width: 0; }
	.gm-lb .gm-lb-nav { width: 40px; height: 40px; }
	.gm-lb-prev { left: 4px; }
	.gm-lb-next { right: 4px; }
}
@media (max-width: 420px) {
	.gm-lb-right .gm-btn[aria-label="Open in new window"],
	.gm-lb-right .gm-btn[aria-label="Print (Ctrl+P)"] { display: none; }
}
.gm-lb-page:empty, .gm-lb-page:empty + .gm-lb-sep { display: none; }
/* the window clips: the close button's tooltip opens leftwards */
.gm-lb-right .gm-lb-close[data-tip]:hover::after,
.gm-lb-right .gm-lb-info[data-tip]:hover::after { left: auto; right: 0; transform: none; }
/* narrow windows: the view tools go first (zoom stays in the pill) */
@media (max-width: 900px) {
	.gm-lb-grp--rotate, .gm-lb-grp--fit { display: none !important; }
}
