/*
 * tq-feed account panel (ACCOUNT-PANEL-V1). The panel sits in the theme's own dropdown holder with the bell's popup
 * classes (.header-dropdown + .notification-popup / -header / -content / .scroll-holder), so the theme gives the place,
 * the surface, the shadow and the light / dark colours. Here: only what our own parts need, on our own classes, through
 * the theme variables (no colour values, gate R5), logical properties only (RTL / LTR, gate R9). Generous gaps between
 * every icon and its label (Sherif 12/11). Phones (≤767px): the panel is a bottom half-sheet.
 * «أجهزتي» buttons on the product page at the end.
 */
.tq-acct-holder {
	display: flex;
	align-items: center;
}

.tq-acct-hd:focus-visible {
	outline: 2px solid var(--g-color);
	outline-offset: 4px;
	border-radius: 4px;
}

.tq-acct-dd .tq-acct {
	inline-size: min(380px, 92vw);
}

/* top line: greeting + «تعديل الاسم» / «تسجيل الخروج» */
.tq-acct__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}

.tq-acct__hi {
	margin: 0;
}

.tq-acct__acts {
	display: flex;
	gap: 16px;
}

.tq-acct__edit,
.tq-acct__cancel {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.tq-acct__edit,
.tq-acct__out,
.tq-acct__cancel {
	opacity: 0.75;
	transition: var(--effect);
}

.tq-acct__edit:hover,
.tq-acct__out:hover,
.tq-acct__cancel:hover,
.tq-acct__edit:focus-visible,
.tq-acct__out:focus-visible {
	opacity: 1;
}

.tq-acct__form {
	display: grid;
	gap: 8px;
	padding-block: 12px;
	padding-inline: 20px;
	border-block-end: 1px solid var(--flex-gray-15);
}

.tq-acct__form[hidden] {
	display: none;
}

.tq-acct__lbl {
	font-size: 13px;
}

.tq-acct__line {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tq-acct__in {
	flex: 1 1 auto;
	min-inline-size: 0;
}

.tq-acct__msg {
	min-block-size: 1.2em;
	font-size: 13px;
}

/* guest block */
.tq-acct__guest {
	display: grid;
	gap: 10px;
	justify-items: start;
	padding-block: 12px;
	padding-inline: 20px;
}

.tq-acct__guest p {
	margin: 0;
	font-size: 14px;
}

/* «متابعاتي» title */
.tq-acct__title {
	margin: 0;
	padding-block: 12px 4px;
	padding-inline: 20px;
	font-size: 15px;
}

.tq-acct__pane .scroll-holder {
	max-block-size: min(52vh, 460px);
	overflow-y: auto;
}

.tq-acct__follows[aria-busy="true"] {
	min-block-size: 80px;
}

/* The theme gives .empty-notification display:block, which beats the hidden attribute. */
.tq-acct__empty[hidden] {
	display: none;
}

/* groups and rows */
.tq-acct__group {
	padding-block: 8px;
}

.tq-acct__group + .tq-acct__group {
	border-block-start: 1px solid var(--flex-gray-15);
}

.tq-acct__h,
.tq-acct__sub {
	margin-block: 8px 4px;
	margin-inline: 20px;
	font-size: 13px;
	opacity: 0.75;
}

.tq-acct__sub {
	font-weight: 400;
}

.tq-acct__row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tq-acct__row .p-wrap {
	flex: 1 1 auto;
	min-inline-size: 0;
}

.tq-acct__tog {
	flex: 0 0 auto;
	min-block-size: 32px;
	padding-inline: 14px;
	border: 0;
	border-radius: var(--tq-radius);
	background: var(--g-color);
	color: var(--awhite);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.tq-acct__tog[aria-pressed="true"] {
	background: transparent;
	box-shadow: inset 0 0 0 2px var(--g-color);
	color: var(--g-color);
}

.tq-acct__tog:disabled {
	opacity: 0.6;
}

.tq-acct__tog:focus-visible {
	outline: 2px solid var(--g-color);
	outline-offset: 2px;
}

.tq-acct__tog-on,
.tq-acct__tog[aria-pressed="true"] .tq-acct__tog-off {
	display: none;
}

.tq-acct__tog[aria-pressed="true"] .tq-acct__tog-on {
	display: inline;
}

.tq-acct__more {
	display: inline-block;
	margin-block-start: 4px;
	font-size: 13px;
	color: var(--g-color);
}

/* footer links («موجزي» · «كل محفوظاتي») = the «محفوظاتي» dropdown footer */
.tq-acct__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 10px;
	padding-inline: 20px;
	border-block-start: 1px solid var(--flex-gray-15);
}

.tq-acct__foot a {
	opacity: 0.75;
	transition: var(--effect);
}

.tq-acct__foot a:hover,
.tq-acct__foot a:focus-visible {
	opacity: 1;
}

.tq-acct__grip {
	display: none;
}

/* phone header: our icon after «محفوظاتي» + the bell, before the dark-mode toggle (16px apart, no glued icons) */
.tq-mhd-acct {
	display: flex;
	align-items: center;
	margin-inline-end: 13px;
}

/* phones: a bottom half-sheet (drag down, Esc or a tap outside closes it) */
@media (max-width: 767px) {
	.tq-acct-holder .tq-acct-dd {
		position: fixed;
		inset-inline: 0;
		inset-block: auto 0;
		z-index: 9999;
		inline-size: auto;
		max-inline-size: none;
		margin: 0;
		transform: translateY(100%);
		transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
	}

	/* the theme moves an open .header-dropdown under its trigger (top); the sheet stays on the bottom edge */
	.tq-acct-holder.dropdown-activated .header-dropdown.tq-acct-dd {
		inset-block: auto 0;
		transform: none;
	}

	.tq-acct-dd .tq-acct {
		inline-size: auto;
		max-block-size: 60vh;
		display: flex;
		flex-direction: column;
		border-start-start-radius: 16px;
		border-start-end-radius: 16px;
		border-end-start-radius: 0;
		border-end-end-radius: 0;
	}

	.tq-acct__pane .scroll-holder {
		max-block-size: 34vh;
	}

	.tq-acct__grip {
		display: block;
		inline-size: 40px;
		block-size: 4px;
		margin-block: 8px 0;
		margin-inline: auto;
		border-radius: 2px;
		background: var(--flex-gray-15);
	}
}

@media (prefers-reduced-motion: reduce) {
	.tq-acct-holder .tq-acct-dd {
		transition: none;
	}
}

/* «أجهزتي» on the product page: two theme buttons in the hero's button row. The theme's .is-btn fills every button
 * blue, so «not chosen» (outline) needs the holder in the selector to show the difference. */
.tq-mydev {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.tq-mydev .tq-mydev__b {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-block-size: 42px;
	padding-inline: 18px;
	border: 0;
	background: transparent;
	box-shadow: inset 0 0 0 2px var(--g-color);
	color: var(--g-color);
	cursor: pointer;
}

.tq-mydev .tq-mydev__b[aria-pressed="true"] {
	background: var(--g-color);
	color: var(--awhite);
}

.tq-mydev__i {
	inline-size: 18px;
	block-size: 18px;
}

.tq-mydev[aria-busy="true"] .tq-mydev__b {
	opacity: 0.6;
}

.tq-mydev__b:focus-visible {
	outline: 3px solid var(--g-color);
	outline-offset: 2px;
}

.tq-mydev__msg {
	font-size: 13px;
}

.tq-mydev__msg:empty {
	display: none;
}
