#main-menu {
	top: 0;
	height: auto;
	z-index: 1000;
	outline: none;
	float: left;
	background-color: transparent;
	margin-left: 5px;
	white-space: nowrap;
	display: inline;
}

#main-menu.readonly {
	top: 0px;
}

#document-header {
	position: relative;
	background: transparent;
}
/*avoid multiple document-headers in readonly mode*/
.main-nav.hasnotebookbar.readonly > #main-menu #document-header {
	display: none;
}

/* hide document-header to free up space when using narrow windows */
@media screen and (max-width: 800px) {
	.main-nav.hasnotebookbar:not(.readonly) #document-header {
		display: none !important;
	}
}

.document-logo {
	position: relative;
	width: 30px;
	height: 30px;
	background-image: var(--doc-icon-url);
	background-size: 16px 16px;
	background-repeat: no-repeat;
	background-position: center;
}

/**!
 * The icon is an anchor without an href, which the browser draws with
 * the plain arrow. The hand pointer comes from here, and the role picks
 * out the case where the icon is clickable.
 */
.document-logo[role='button'] {
	cursor: pointer;
}

.document-title {
	white-space: nowrap;
	display: flex;
	align-items: baseline;
	justify-content: center;
	flex-direction: row;
	flex-wrap: wrap;
	flex: 1 1 auto;
	gap: var(--spacing-s);
	position: relative;
}

.document-title > .loading-bar-container,
.document-title > .progress-bar {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
}

.document-title:focus-within > label[for='document-name-input'] {
	clip: unset;
	height: auto;
	overflow: visible;
	position: static;
	width: auto;
	flex: 0 0 auto;
	font-family: var(--cool-font);
	font-size: var(--default-font-size);
	color: var(--color-text-light);
}

.main-nav.hasnotebookbar .document-title:focus-within > label[for='document-name-input'] {
	font-size: clamp(var(--tb-min-fs), var(--tb-fs-s), var(--tb-max-fs));
}

.document-title:focus-within > #document-name-input.editable {
	width: auto !important;
	min-width: 0;
	flex: 1 1 auto;
}

.readonly .document-title {
	justify-content: flex-end;
}

nav [id^='save'].unotoolbutton,
#toolbar-up [id^='save'].unotoolbutton {
	display: flex;
	font-size: var(--default-font-size);
	font-family: var(--cool-font);
	position: relative;
	background: transparent;
	line-height: 0;
	align-items: center;
	justify-content: center;
}

/* While a save runs the spinner alone shows. Hiding the image rather than removing it keeps
   the button at its normal size. */
nav [id^='save'].saving img,
#toolbar-up [id^='save'].saving img {
	visibility: hidden;
}

/* The spinner drawn over the save icon while a save runs. The floppy disk in the icon sits
   still; the drawing animates itself through the animation elements it carries, turning its
   arc segment along the faint track circle. Both circles stroke with currentColor, so the
   one drawing follows the light theme, the dark theme and a branded bar alike. The spinner
   ignores the pointer. */
[id^='save'] .save-spinner {
	display: none;
	position: absolute;
	inset: 0;
	margin: auto;
	width: 20px;
	height: 20px;
	color: var(--color-main-text);
	pointer-events: none;
}

[id^='save'].saving .save-spinner {
	display: block;
}

.save-spinner circle {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

.save-spinner .save-spinner-track {
	opacity: 0.25;
}

.save-spinner .save-spinner-arc {
	stroke-linecap: round;
}

nav [id^='save'].saved img {
	background: url('images/lc_saved.svg') no-repeat center;
	filter: grayscale(0);
}

#toolbar-up [id^='save'].saved img {
	background: url('images/compact_saved.svg') no-repeat center;
	filter: grayscale(0);
}

#document-last-saved {
	display: none;
}

#document-titlebar {
	display: inline-table; /*new*/
	table-layout: fixed;
	border-spacing: 5px 0;
	max-height: 39px;
	flex-grow: 1;
}

.readonly #document-titlebar {
	float: right;
	margin-right: 52px;
}

.main-nav.hasnotebookbar:not(.readonly) #document-titlebar {
	display: flex;
	align-self: center;
}

@media screen and (max-width: 900px) {
	.main-nav.hasnotebookbar:not(.readonly) #document-titlebar {
		display: none;
	}
	.notebookbar-tabs-container {
		flex: 1 1 auto !important;
	}
}

.main-nav.readonly #optionstoolboxdown {
	display: none;
}
.main-nav {
	box-sizing: border-box;
	height: var(--header-height); /* on mouseover menubar items, border emerges */
	width: 100%;
	background: var(--color-background-lighter);
	padding: 3px 3px 3px 0;
	white-space: nowrap;
	z-index: 1001;
	display: flex;
	align-items: center;
}
.main-nav.readonly {
	position: relative;
	border-bottom: 1px solid var(--color-border);
}
.main-nav.hasnotebookbar {
	height: var(--header-height);
}

.main-nav.hasnotebookbar:not(.readonly) {
	background: var(--color-main-background);
	padding: 0px;
	overflow: visible;
	padding-inline-start: 5px;
}

/* Customizations to sm-simple theme to make it look like LO menu, lo-menu class */
.lo-menu {
	border: none;
	box-shadow: none;
	background: var(--color-main-background);
	-webkit-touch-callout: none; /* iOS long-press callout */
	-webkit-user-select: none;
	        user-select: none;
	cursor: default;
}

.lo-menu a, .lo-menu a:hover, .lo-menu a:focus, .lo-menu a:active {
	font-family: var(--cool-font);
	font-size: var(--default-font-size);
	line-height: 15px;
}

.lo-menu ul a, .lo-menu ul a:hover, .lo-menu ul a:focus, .lo-menu ul a:active {
	font-size: var(--default-font-size);
}

.lo-menu a.disabled {
	cursor: not-allowed;
}

.lo-menu > li > a, .lo-menu > li > a.has-submenu {
	padding: var(--spacing-m);
	z-index: 400;
	border: 1px solid transparent;
}

.lo-menu a, .lo-menu a:hover, .lo-menu a:focus, .lo-menu a:active, .lo-menu a.highlighted {
	padding: 5px 22px;
	color: var(--color-main-text);
}
.lo-menu a:hover, .lo-menu a:focus, .lo-menu a:active, .lo-menu a.highlighted {
	background-color: var(--color-background-darker);
	color: var(--color-text-darker);
}
.lo-menu > li, .lo-menu > li > .disabled {
	background: transparent; /* top-level menus remain greyish */
	border-left-color: transparent;
}
.lo-menu > li .disabled {
	background: var(--color-main-background);
	color: var(--color-text-light);
}
.lo-menu > li > a:hover, .lo-menu > li > a:focus, .lo-menu > li > a:active, .lo-menu > li > a.highlighted {
	background-color: var(--color-background-darker);
	color: var(--color-text-darker);
	border-color: var(--color-border-darker);
	border-bottom: 1px solid var(--color-border-darker);
	padding: var(--spacing-m);
}
.main-nav > #document-header {
	display: flex;
	align-items: center;
}
.main-nav > #document-header > a.document-logo,
.main-nav > #document-header > a.document-logo:hover,
.main-nav > #document-header > a.document-logo:focus,
.main-nav > #document-header > a.document-logo:active,
.main-nav > #document-header > a.document-logo.highlighted {
	background-color: transparent;
	background-image: var(--doc-icon-url);
	background-size: 16px 16px;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid transparent;
	padding: var(--spacing-m);
}
.lo-menu > li > a.highlighted {
	border-bottom-color: var(--color-border-dark);
}
.lo-menu > li > ul {
	margin-top: -1px !important;
	z-index: 400;
}
.lo-menu > li > a span.sub-arrow {
	display: none;
}
/* Disable parent menu styles for notebookbar */
.lo-menu.notebookbar > li > a {
	background-color: transparent;
	border: none;
	line-height: normal;
}

.lo-menu ul {
	border: 1px solid var(--color-border);
	background: var(--color-main-background);
}
.lo-menu ul a span.sub-arrow {
	right: 0;
	margin-right: 5px;
	background: transparent url('images/lc_menu_chevron.svg') no-repeat center right; /* we want them to be transparent always whether mobile or desktop */
	color: transparent;
}
.lo-menu ul a:hover > span.sub-arrow {
	filter: brightness(100);
}
/* The smartmenus theme has rules of its own for a menu that runs from right to
   left, more specific than the ones above, with wider padding and a border on
   the first entry. These give that menu the same look as the other one, with
   the submenu arrows at the left and pointing left. */
.lo-menu.sm-simple.sm-rtl > li > a,
.lo-menu.sm-simple.sm-rtl > li > a.has-submenu {
	padding: var(--spacing-m);
}
.lo-menu.sm-simple.sm-rtl > li:first-child {
	border-left-color: transparent;
}
.lo-menu.sm-simple.sm-rtl ul a.has-submenu {
	padding: 5px 22px;
}
.lo-menu.sm-simple.sm-rtl ul a span.sub-arrow {
	right: auto;
	left: 0;
	margin-right: 0;
	margin-left: 5px;
	transform: scaleX(-1);
}
.lo-menu ul a:has(> span.shortcut) {
	display: flex;
	align-items: center;
}
.lo-menu ul a > span.shortcut {
	margin-inline-start: auto;
	padding-inline-start: 16px;
	color: var(--color-text-light);
}
.lo-menu ul > li {
	border-left: 0;
	border-top: none;
}
.lo-menu a.separator {
	height: 1px;
	margin: 4px 0;
	overflow: hidden;
	padding-top: 0;
	padding-bottom: 0;
	background-color: var(--color-border-lighter);
}
/* lo-menu customizations end */

.main-nav:after {
	clear: both;
	content: '\00a0';
	display: block;
	height: 0;
	font: 0px/0 serif;
	overflow: hidden;
}

/* Hamburger button */

.main-menu-btn {
	margin: 2px 8px;
	position: relative;
	display: none;
	width: 22px;
	height: 22px;
	text-indent: 17px;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.main-menu-btn:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
	border-radius: var(--border-radius);
}

/* Hamburger icon */

.main-menu-btn-icon,
.main-menu-btn-icon:before,
.main-menu-btn-icon:after {
	position: absolute;
	top: 60%;
	left: 1px;
	height: 1px;
	width: 20px;
	background: var(--color-main-text);
	transition: all var(--duration-normal);
}

.main-menu-btn-icon:before {
	content: '';
	top: -8px;
	left: 0;
}

.main-menu-btn-icon:after {
	content: '';
	top: 8px;
	left: 0;
}

/* hide menu state checkbox (keep it visible to screen readers) */

#main-menu-state {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	border: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}


/* always show the menu in desktop view */
#main-menu-state:not(:checked) ~ #main-menu {
	display: block;
}

#main-menu-state:checked ~ #main-menu {
	display: block;
}

/* Some more lo-menu specific customizations */

/* The smartmenus plugin doesn't seem to have support for icons, so implement our own pseudo-elements */
.lo-menu-item-checked::before {
	position: absolute;
	content: ' ';
	left: 2px;
	background: url('images/lc_listitem-selected.svg') no-repeat left -2px;
	width: 20px;
	height: 20px;
}

.lo-menu-item-checked:hover::before {
	color: var(--color-text-dark);
	filter: brightness(100);
}

.writer-icon-img {
	--doc-icon-url: url('images/x-office-document.svg');
}

.calc-icon-img {
	--doc-icon-url: url('images/x-office-spreadsheet.svg');
}

.impress-icon-img {
	--doc-icon-url: url('images/x-office-presentation.svg');
}

.draw-icon-img {
	--doc-icon-url: url('images/x-office-drawing.svg');
}

#menu-last-mod a {
	color: var(--color-text-light);
	padding: 8px 15px 7px;
	z-index: 400;
	border: 1px solid transparent;
}

#menu-last-mod a:hover {
	color: var(--color-text-darker);
}

/* For classic mode */
#main-menu .locking-disabled, #menu-nb-hamburger .locking-disabled {
	color: var(--color-text-light) !important;
	background-color: var(--color-background-lighter);
	box-shadow: inset 0 0 2px 0 rgba(0,0,0,0.2);
	background: url('images/lc_lock.svg') right top / 24px no-repeat
}

#main-menu .locking-disabled {
	background-size: 19px;
	background-position-y: 3px;
}

#main-menu .locking-disabled:hover, #menu-nb-hamburger .locking-disabled:hover {
	background-color: var(--color-background-lighter);
	background-position: right bottom !important;
}

#main-menu .locking-disabled:hover {
	background-position-y: -17px !important;
}

/* For notebook bar mode and sidebar*/
.locking-disabled:not(.mobile-wizard) img.unobutton, #toolbar-up .locking-disabled .w2ui-tb-image.w2ui-icon {
	background: url('images/lc_lock.svg') center top / 24px no-repeat !important;
	width: 24px !important;
	padding-left: 24px;
	box-sizing: border-box;
}

.locking-disabled:hover img.unobutton, #toolbar-up .locking-disabled .w2ui-tb-image.w2ui-icon:hover {
	background-position: bottom !important;
}

.locking-disabled > .notebookbar.has-label img.unobutton {
	background-size: 32px;
	padding-left: 32px;
}
/* For mobile mode */
#mobile-wizard .locking-overlay {
	position: relative;
	width: 20px;
	height: 20px;
	right: 0px;
	bottom: 0px;
	z-index: 2;
	border-radius: var(--border-radius);
	text-align: right;
	margin-right: 4%;
	overflow: hidden;
}

#mobile-wizard:not(.menuwizard) .locking-overlay {
	top: -38px;
	background: var(--color-background-lighter);
	left: -8px;
	box-shadow: 0 0 1px 2px #00000025;
}

#mobile-wizard:not(.menuwizard) button ~ .locking-overlay {
	/* targetting primary buttons on mobile e.g.: master slide*/
	margin: auto;
	padding-right: 77%;
	background-color: transparent;
	box-shadow: none;
	filter: brightness(4);
}

#mobile-wizard:not(.menuwizard) .locking-overlay-lock {
	filter: brightness(0.8) contrast(1.8);
}

#mobile-wizard.menuwizard .locking-overlay-lock {
	width: 20px;
	filter: brightness(0.8) contrast(1.8);
	animation-iteration-count: 1;
	animation-direction: normal; /* Safari 4.0 - 8.0 */
	animation-play-state: running;
	animation-name: up-n-down-anim;
	animation-duration: 2s;
	animation-timing-function: ease-in-out;
}
@keyframes up-n-down-anim {
	0% {margin-top: 0;}
	50% {margin-top: -20px;}
	100% {margin-top: 0;}
}

/* The lock icon rises once and comes back only to catch the eye. It starts and ends at a top
   margin of zero, which is where it sits with no animation at all. */
@media (prefers-reduced-motion: reduce) {
	#mobile-wizard.menuwizard .locking-overlay-lock {
		animation: none;
	}
}

.sidebar .locking-overlay {
	height: 22px;
	overflow: hidden;
	float: left;
	position: relative;
	right: -7px;
	box-shadow: 0 0 1px 1px #0003;
	border-radius: 12px;
}
.sidebar .locking-overlay-lock {
	width: 20px;
	background-color: var(--color-background-lighter);
	padding: 1px;
}
.sidebar .locking-disabled:hover .locking-overlay-lock {
	margin-top: -20px;
}
.sidebar .locking-disabled button:hover ~ .locking-overlay {
	box-shadow: 0 0 4px 0 var(--color-primary-darker);
}
.restricted-item {
	display: none !important;
}
