/* gmailtheme — related mail (js/related.js): icon pills in the message toolbar + the related page over the mail card */

/* ------------------------------------------------------------------ message bar, laid out like the related page
   row 1: ← | person (#gm-bar-id) | 3 of 50 ‹ ›   row 2 (#gm-bar-tabs): tools (#gm-msg-tools, moved in by related.js, shown first via order) … tab pills */
div#mailnav-bar {
	container: mnbar / inline-size; /* the guards below follow the bar's own width, not the window's */
	height: auto;
	flex-wrap: wrap;
	align-items: center;
	padding: 4px 16px 0 8px !important;
	row-gap: 0 !important;
}
#gm-msg-back { order: 0; display: flex; align-items: center; }
#gm-msg-back .gm-btn[data-tip]:hover::after { left: 0; transform: none; }
#gm-bar-id {
	order: 1;
	flex: 1 1 160px;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	height: 56px;
	margin-inline-end: 8px;
	padding: 0 12px 0 4px;
	border-radius: 28px;
	cursor: pointer;
	outline: none;
	transition: background-color .15s;
}
#gm-bar-id[hidden] { display: none; }
#gm-bar-id:hover, #gm-bar-id.gm-addr--active { background: var(--gm-hover, #f1f3f4); }
#gm-bar-id:focus-visible { box-shadow: inset 0 0 0 2px var(--y-purple, #7d2eff); }
#gm-bar-id .gm-rp__person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
/* person block = 2 rows: name + email | "to me ▾" · date (both moved up from the bar message's header) */
#gm-bar-id .gm-bar-l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#gm-bar-id .gm-bar-l1 .gm-rp__name { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gm-bar-id .gm-bar-l1 .gm-rp__sub { flex: 0 1 auto; min-width: 0; }
#gm-bar-id .gm-bar-l2 { display: flex; align-items: center; gap: 6px; min-width: 0; height: 20px; font-size: 12px; color: var(--gm-text-3); }
#gm-bar-id .gm-bar-l2[hidden] { display: none; }
#gm-bar-id .gm-bar-tome { min-width: 0; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gm-text-2); }
#gm-bar-id .gm-bar-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* the bar message's own "to me" + date now live in the bar */
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header .gm-tome,
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header .gm-date { display: none !important; }

/* its star / Reply / ⋮ are in the toolbar now (gmail.js); Mail's menu stays in the DOM, invisible, so the toolbar's ⋮
   can still drive the items that have no public method (viaMailMenu) */
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header .gm-star-btn { display: none !important; }
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header .right .action-items {
	position: absolute !important;
	right: 16px;
	opacity: 0;
	pointer-events: none;
}
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header__avatar { height: 0 !important; }
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header { padding-top: 4px !important; }
#mail-message .envelope[data-gm-barmsg].envelope--expanded .envelope__header .right { height: 0; min-height: 0 !important; overflow: visible; }
html.gm-mailmenu-ghost .v-popper__popper { opacity: 0 !important; }

/* toolbar text buttons (Reply / Forward) */
#gm-msg-reply button.gm-btn.gm-tbtext {
	width: auto;
	min-width: 0;
	height: 36px;
	gap: 6px;
	margin: 0 0 0 6px !important;
	padding: 0 14px 0 10px !important;
	border: 1px solid var(--gm-line, #e0e4e9) !important;
	border-radius: 18px;
	color: var(--gm-text);
	font: 500 13px/1 var(--gm-font);
	white-space: nowrap;
}
#gm-msg-reply button.gm-btn.gm-tbtext .gm-ic { width: 18px; height: 18px; }

/* message details rows (contact card .gm-cc__msg, recipients.js) */

.gm-cc__msg { padding: 10px 18px 12px 8px; font: 400 13px/20px var(--gm-font); }
.gm-bar-det__row { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 2px 0; }
.gm-bar-det__k { color: var(--gm-text-3); text-align: right; }
.gm-bar-det__v { min-width: 0; overflow-wrap: anywhere; }
.gm-bar-det__addr b { font-weight: 600; }
.gm-bar-det__addr span { color: var(--gm-text-2); }
.gm-rp__id { flex: 1; min-width: 0; }
#gm-bar-tabs #gm-msg-tools { order: -1; padding-inline-end: 8px; flex: none; } /* tools first, pills at the right end (swapped 2026-11-13) */
#gm-msg-reply { order: 2; flex: none; display: flex; align-items: center; gap: 6px; margin-inline-end: 8px; }
#gm-msg-reply button.gm-btn.gm-tbtext { margin: 0 !important; }
div#mailnav-bar .mailnav-pos { order: 3; margin-inline-start: 4px !important; white-space: nowrap; }
div#mailnav-bar > button { order: 4; }
#gm-bar-tabs.gm-rp__tabs {
	order: 9;
	flex: 0 0 100%;
	flex-wrap: nowrap; /* never a third row: the tabs strip shrinks (then scrolls), the tools keep their place */
	min-width: 0; /* without it the row kept its content width and ran past the bar instead of the strip scrolling */
	align-items: center;
	padding: 2px 0 10px 40px; /* = #gm-msg-back width: the tools start where #gm-bar-id does */
	border-bottom: 0;
}
#gm-bar-tabs[hidden] { display: none; }
#gm-bar-tabs .gm-bar-tabscroll {
	flex: 0 1 auto;
	margin-inline-start: auto;
	min-width: 0;
	display: flex;
	gap: 8px;
	padding: 2px 2px 2px 2px; /* room for the focus ring */
	overflow-x: auto;
	scrollbar-width: none;
}
#gm-bar-tabs .gm-bar-tabscroll::-webkit-scrollbar { display: none; }
#gm-bar-tabs .gm-rp__tab { flex: none; }
#gm-bar-tabs #gm-msg-tools { flex: none; }
/* narrow bar: tabs → icon + count (name on hover), Reply / Forward → icons */
@container mnbar (max-width: 1040px) {
	#gm-bar-tabs .gm-rp__tablabel { display: none; }
	#gm-bar-tabs button.gm-rp__tab { padding-inline-start: 10px !important; gap: 6px; }
}
@container mnbar (max-width: 720px) {
	#gm-msg-reply button.gm-btn.gm-tbtext { padding: 0 9px !important; }
	#gm-msg-reply button.gm-btn.gm-tbtext > span:not(.gm-ic) { display: none; }
	#gm-msg-reply button.gm-btn.gm-tbtext[aria-label]:hover::after {
		content: attr(aria-label); position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
		background: #3c4043; color: #fff; font: 500 12px/16px var(--gm-font-text); padding: 4px 8px; border-radius: 4px;
		white-space: nowrap; z-index: 10000; pointer-events: none;
	}
}

/* the message from the bar's person: no second avatar / name / email (date, "to me", star, reply, ⋮ stay) */
#mail-message .envelope[data-gm-barsender].envelope--expanded .envelope__header__avatar { visibility: hidden; }
#mail-message .envelope[data-gm-barsender].envelope--expanded .envelope__header .sender,
#mail-message .envelope[data-gm-barsender].envelope--expanded .envelope__header .gm-sender-email { display: none !important; }

/* ------------------------------------------------------------------ related page */
body.gm-rp-open #app-content-vue > .app-content-wrapper { visibility: hidden; }
:is(.gm-rp, #mailnav-bar) {
	--rp-accent: var(--y-purple, var(--gm-blue, #0b57d0));
	--rp-tint: color-mix(in srgb, var(--rp-accent) 8%, #fff);
}
.gm-rp {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: block;
	background: var(--gm-surface, #fff);
	border-radius: inherit;
	overflow: hidden;
	font-family: var(--gm-font);
	color: var(--gm-text);
	font-size: 14px;
}
.gm-rp[hidden] { display: none; }
/* contents layer: counter-slides during the open wipe (related.js show()) */
.gm-rp__wipe { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--gm-surface, #fff); }
.gm-rp__list { position: relative; z-index: 1; background: var(--gm-surface, #fff); }
.gm-rp__ghost { position: absolute !important; left: 0; right: 0; z-index: 0; overflow: hidden !important; pointer-events: none; }
/* tab / page wipe edge (related.js render): shadow cast from the incoming list onto the outgoing one */
.gm-rp__edge { position: absolute; left: 0; width: 28px; z-index: 2; pointer-events: none; will-change: transform;
	background: linear-gradient(90deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0)); }
.gm-rp__edge--l { margin-left: -28px; background: linear-gradient(270deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0)); }

/* page → mail: placeholder wiped in over the page (related.js wipeToMail) */
.gm-rp-ph { position: absolute; inset: 0; z-index: 41; overflow: hidden; border-radius: inherit; pointer-events: none; contain: strict; }
.gm-rp-ph__panel { position: absolute; inset: 0; overflow: hidden; background: var(--gm-surface, #fff); will-change: transform; }
.gm-rp-ph__wipe { position: absolute; inset: 0; will-change: transform; font-family: var(--gm-font); color: var(--gm-text); }
.gm-rp-ph__bar { display: flex; align-items: center; height: 60px; padding: 4px 16px 0 56px; }
.gm-rp-ph__bar .gm-rp__person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gm-rp-ph__subj { position: absolute; left: 72px; right: 120px; top: 133px; font: 600 20px/28px var(--gm-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gm-rp__bar {
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 64px;
	padding: 0 16px 0 8px;
}
.gm-rp__av {
	flex: none;
	width: 40px;
	height: 40px;
	margin-inline-start: 4px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: hsl(var(--h, 270) 60% 92%);
	color: hsl(var(--h, 270) 45% 35%);
	font: 600 15px/1 var(--gm-font);
}
.gm-rp__av img { width: 100%; height: 100%; object-fit: cover; }
.gm-rp__person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.gm-rp__id { flex: 1; min-width: 0; }
.gm-rp__name { font: 600 18px/24px var(--gm-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-rp__sub { font-size: 13px; line-height: 18px; color: var(--gm-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-rp__pos { flex: none; margin-inline-end: 8px; font-size: 12px; color: var(--gm-text-3); font-variant-numeric: tabular-nums; }

/* row 2: the inbox's list toolbar (#gm-rp-tools) on the left, the tab pills at the right end — like the message bar */
.gm-rp__toolrow {
	flex: none;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	padding: 4px 20px 12px 12px;
	border-bottom: 1px solid var(--gm-line);
}
#gm-rp-tools { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
#gm-rp-tools .gm-selbox { display: inline-flex; align-items: center; margin-inline-end: 4px; }
#gm-rp-tools .gm-selbox .gm-btn:first-child { width: 32px; min-width: 32px; border-radius: 4px 0 0 4px; }
#gm-rp-tools .gm-selbox .gm-btn:last-child { width: 18px; min-width: 18px; border-radius: 0 4px 4px 0; }
#gm-rp-tools .gm-selbox .gm-btn:first-child[data-tip]:hover::after { left: 0; transform: none; }
#gm-rp-tools [data-fit-hide] { display: none !important; }
.gm-rp__toolrow--files #gm-rp-tools { visibility: hidden; } /* Attachments tab: file cards, nothing to select */
.gm-rp__toolrow > .gm-rp__tabs { flex: 0 1 auto; flex-wrap: nowrap; margin-inline-start: auto; padding: 2px; border-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.gm-rp__toolrow > .gm-rp__tabs::-webkit-scrollbar { display: none; }
#gm-related .gm-rp__toolrow .gm-rp__tab { flex: none; }

/* tabs: pill buttons with a count chip */
.gm-rp__tabs {
	flex: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 20px 12px 20px;
	border-bottom: 1px solid var(--gm-line);
}
:is(#gm-related, #gm-bar-tabs) button.gm-rp__tab {
	all: unset;
	margin: 0 !important;
	min-height: 0 !important;
	background: var(--gm-surface, #fff) !important;
	box-shadow: none !important;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 8px 0 12px !important;
	border: 1px solid var(--gm-line) !important;
	border-radius: 18px !important;
	color: var(--gm-text) !important;
	font: 500 13px/1 var(--gm-font) !important;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
:is(#gm-related, #gm-bar-tabs) .gm-rp__tab[hidden] { display: none; }
:is(#gm-related, #gm-bar-tabs) .gm-rp__tab .gm-ic { width: 18px; height: 18px; color: var(--gm-text-2, #444746); }
:is(#gm-related, #gm-bar-tabs) button.gm-rp__tab:hover { background: var(--gm-hover, #f1f3f4) !important; border-color: #d0d4d8 !important; }
:is(#gm-related, #gm-bar-tabs) .gm-rp__tab:focus-visible { outline: 2px solid var(--gm-text-2, #444746); outline-offset: 2px; }
.gm-rp__count {
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	box-sizing: border-box;
	border-radius: 11px;
	background: var(--gm-hover, #f1f3f4);
	color: var(--gm-text-2, #444746);
	font: 700 11px/22px var(--gm-font);
	text-align: center;
	font-variant-numeric: tabular-nums;
}
:is(#gm-related, #gm-bar-tabs) button.gm-rp__tab--on, :is(#gm-related, #gm-bar-tabs) button.gm-rp__tab--on:hover { background: #e9eaec !important; border-color: #c7cbd0 !important; font-weight: 700 !important; }
:is(#gm-related, #gm-bar-tabs) .gm-rp__tab--on .gm-ic { color: var(--gm-text, #1f1f1f); }
:is(#gm-related, #gm-bar-tabs) .gm-rp__tab--on .gm-rp__count { background: var(--gm-surface, #fff); color: var(--gm-text, #1f1f1f); }

/* rows, laid out like the inbox */
.gm-rp__list { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.gm-rp__list--busy { opacity: .55; transition: opacity .1s .15s; }
.gm-rp__msg { padding: 24px; color: var(--gm-text-3); }
.gm-rp__row {
	display: grid;
	grid-template-columns: 32px minmax(50px, 96px) 1fr 20px 84px;
	align-items: center;
	gap: 12px;
	height: 52px;
	padding: 0 20px 0 16px;
	border-bottom: 1px solid var(--gm-line);
	cursor: pointer;
	outline: none;
}
/* Nextcloud's server.css gives every div/span cursor: default, so only the row's gaps showed the hand and it flickered
   while moving across a row (2026-11-16): the whole row / file card is one pointer target */
#gm-related :is(.gm-rp__row, .gm-rp__file, .gm-rp__file *, .gm-rp__row *) { cursor: pointer; }
.gm-rp__row:hover { background: var(--rp-tint); }
.gm-rp__row:focus-visible { box-shadow: inset 0 0 0 2px var(--rp-accent); }
.gm-rp__row--here { background: var(--gm-bg, #f6f6f6); }
/* selected (the round icon = select toggle, like the inbox rows) */
.gm-rp__row--sel, .gm-rp__row--sel:hover { background: var(--y-purple-light, color-mix(in srgb, var(--rp-accent) 14%, #fff)); }
.gm-rp__dir { cursor: pointer; transition: background-color .15s, color .15s; }
.gm-rp__dir:hover { background: color-mix(in srgb, var(--rp-accent) 18%, #fff); }
.gm-rp__dir:hover .gm-ic { color: var(--rp-accent); }
.gm-rp__row--sel .gm-rp__dir { background: var(--rp-accent); }
.gm-rp__row--sel .gm-rp__dir .gm-ic { color: #fff; }
/* an action in flight (related.js act): greyed, a highlight running across, until the server confirms; a row whose
   state changed but stays gets a short flash */
.gm-rp__row--pending { position: relative; overflow: hidden; pointer-events: none; background: linear-gradient(90deg, #e2e5e9, #d9dde2, #e2e5e9) !important; }
.gm-rp__row--pending > * { opacity: .45; filter: grayscale(1); }
.gm-rp__row--pending::after {
	content: '';
	position: absolute;
	inset: 0 auto 0 0;
	width: 40%;
	/* silver sheen: a bright, slightly slanted band sweeping over the grey row */
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, .55) 40%, #fff 50%, rgba(255, 255, 255, .55) 60%, rgba(255, 255, 255, 0) 75%, transparent 100%);
	animation: gm-pending-run 1.3s ease-in-out infinite; /* keyframes in gmail.css */
	pointer-events: none;
}
@keyframes gm-rp-done { from { background-color: color-mix(in srgb, var(--rp-accent) 16%, #fff); } }
.gm-rp__row--done { animation: gm-rp-done .9s ease-out; }
@media (prefers-reduced-motion: reduce) { .gm-rp__row--pending::after { animation: none; width: 100%; opacity: .5; } }
/* in a Trash folder */
.gm-rp__tag--trash { background: #fde8e8; color: #b42318; }
.gm-rp__row--trash .gm-rp__subj, .gm-rp__row--trash .gm-rp__who { color: var(--gm-text-2); }
#gm-related button.gm-rp__fmail em.gm-rp__tag { flex: none; margin: 0; font-style: normal; }
.gm-rp__dir { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--rp-tint); }
.gm-rp__dir .gm-ic { width: 16px; height: 16px; color: var(--rp-accent); }
.gm-rp__dir--sent { background: var(--gm-bg, #f6f6f6); }
.gm-rp__dir--sent .gm-ic { color: var(--gm-text-3); }
.gm-rp__who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gm-text); }
.gm-rp__main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-rp__subj { color: var(--gm-text); }
.gm-rp__prev { color: var(--gm-text-3); }
.gm-rp__row--unread .gm-rp__who, .gm-rp__row--unread .gm-rp__subj, .gm-rp__row--unread .gm-rp__date { font-weight: 700; color: var(--gm-text); }
.gm-rp__tag { display: inline-block; margin-inline-end: 8px; padding: 1px 8px; border-radius: 8px; background: var(--rp-tint); color: var(--rp-accent); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.gm-rp__clip { display: flex; justify-content: center; }
.gm-rp__clip .gm-ic { width: 16px; height: 16px; color: var(--gm-text-3); }
.gm-rp__date { text-align: right; font-size: 12px; color: var(--gm-text-3); white-space: nowrap; }

@media only screen and (max-width: 700px) {
	.gm-rp__row { grid-template-columns: 32px 1fr 56px; height: auto; padding: 10px 16px; }
	.gm-rp__who { display: none; }
	.gm-rp__clip { display: none; }
}

/* ------------------------------------------------------------------ Attachments tab: file view (related.js filesView) */
.gm-rp__fileview { padding: 12px 20px 24px; }
.gm-rp__fstatus { margin: 0 0 12px; color: var(--gm-text-3); font-size: 12px; }
.gm-rp__files { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.gm-rp__fslot { display: contents; }
.gm-rp__file {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--gm-line, #e0e4e9);
	border-radius: 12px;
	overflow: hidden;
	background: var(--gm-surface, #fff);
	cursor: pointer;
	outline: none;
	transition: box-shadow .15s, border-color .15s, transform .12s;
}
.gm-rp__file:hover { border-color: #d0d4d8; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.gm-rp__file:active { transform: scale(.985); }
.gm-rp__file:focus-visible { box-shadow: 0 0 0 2px var(--gm-text-2, #444746); }
.gm-rp__fthumb {
	position: relative;
	height: 132px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--gm-bg, #f6f6f6);
	border-bottom: 1px solid var(--gm-line, #e0e4e9);
	overflow: hidden;
}
.gm-rp__fmime { width: 48px; height: 48px; }
.gm-rp__fimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; background: #fff; }
.gm-rp__fthumb--ok .gm-rp__fmime { visibility: hidden; }
.gm-rp__finfo { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px; min-width: 0; }
.gm-rp__fname { font: 500 13px/18px var(--gm-font); color: var(--gm-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-rp__fmeta { font-size: 12px; line-height: 16px; color: var(--gm-text-3); }
#gm-related button.gm-rp__fmail {
	all: unset;
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	margin-top: 6px;
	padding: 4px 6px;
	margin-inline: -6px;
	border-radius: 6px;
	color: var(--gm-text-2);
	font: 400 12px/16px var(--gm-font);
	cursor: pointer;
}
#gm-related button.gm-rp__fmail:hover { background: var(--gm-hover, #f1f3f4); color: var(--gm-text); }
#gm-related button.gm-rp__fmail .gm-ic { width: 14px; height: 14px; flex: none; }
#gm-related button.gm-rp__fmail span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
