/* Overlay for popups and dropdowns allowing to handle click outside */
.jsdialog-overlay {
	position: absolute;
	background: transparent;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	max-width: 100%;
	max-height: 100%;
	z-index: 2000;
	display: flex;
	overflow: hidden;
}

.jsdialog-overlay.cancellable {
	animation: none;
}

.jsdialog-overlay.dimmed {
	background: #1c5fa814;
}

/* JSDialog windows */

.lokdialog_container.ui-dialog.ui-widget-content.modalpopup,
.jsdialog-window.modalpopup {
	z-index: 2001;
}

.jsdialog-window {
	position: absolute;
	z-index: 1105;
}

.jsdialog-container {
	position: absolute;
}

.jsdialog-window:not(.modalpopup) .jsdialog-container:not(.snackbar) {
	min-width: 400px;
}

.jsdialog-window.messagebox:not(.modalpopup) .jsdialog-container:not(.snackbar) {
	min-width: 300px;
	max-width: 380px;
}

/* Message boxes take their 300px min-width rather than sizing to their text, so
   a sentence much longer than that wraps even though the 380px cap leaves room.
   The overwrite warning is two such sentences, so let it size to its content. */
.jsdialog-window.messagebox:not(.modalpopup)
.jsdialog-container:not(.snackbar):has(#CheckWarningDialog) {
	width: max-content;
	max-width: 560px;
}

/* A dialog that has a window of its own keeps its natural size in a narrow
   window, because that window is sized to the dialog. */
@media (max-width: 480px) {

	body:not(.jsdialog-popout-body)
	.jsdialog-window:not(.modalpopup)
	.jsdialog-container:not(.snackbar) {
		min-width: unset;
		width: 460px;
	}
}

.jsdialog-container:not(.snackbar) td[role='gridcell'] {
	padding-left: 5px;
	padding-right: 5px;
}

div.ui-treeview-icon-column {
	height: 100%;
	text-align: right;
}

#AcceptRejectChangesDialog .ui-treeview {
	padding-top: 0;
}

#AcceptRejectChangesDialog #RedlineViewPage.jsdialog.ui-grid-cell {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-m);
}
#AcceptRejectChangesDialog #RedlineFilterPage .ui-timefield {
	margin: 5px;
}

/* properties of a form control or a form (svx/ui/formpropertydialog.ui). each property is
   a grid of its own, label, field and up to two buttons; we let all of them take part in
   the one grid of the page, so labels and fields line up as in the office. the builder
   puts the column of a field and the width inline, hence the !important */
#FormPropertyDialog .ui-scrollwindow {
	width: 30em !important;
	height: auto !important;
	max-height: 50vh !important;
	overflow-x: hidden;
}
#FormPropertyDialog [id^='playground'].ui-grid-cell {
	display: grid !important;
	grid-template-columns: max-content minmax(0, 1fr) auto auto !important;
	grid-auto-rows: auto !important;
	align-content: start !important;
	align-items: center;
	column-gap: 8px;
	row-gap: 6px;
}
#FormPropertyDialog [id^='BrowserLine'].ui-grid {
	display: contents !important;
}
#FormPropertyDialog [id^='BrowserLine'] > :first-child {
	grid-column: 1;
}
/* a field reaches the right edge, unless a button of its line stands there */
#FormPropertyDialog [id^='BrowserLine'] > :nth-child(2) {
	grid-column: 2 / -1 !important;
}
#FormPropertyDialog [id^='BrowserLine']:has(> .ui-pushbutton-wrapper:not(.hidden)) > :nth-child(2) {
	grid-column: 2 !important;
}
#FormPropertyDialog [id^='BrowserLine']:has(> [id^='morebrowse'].hidden) > [id^='browse']:not(.hidden) {
	grid-column: 3 / -1 !important;
	justify-content: flex-end !important;
}
#FormPropertyDialog [id^='BrowserLine'] > .ui-pushbutton-wrapper.hidden {
	display: none !important;
}

/* Select Certificate dialog (xmlsec/ui/selectcertificatedialog.ui). The
   !important overrides beat the inline styles the builder puts on
   containers (display: grid with stretched auto columns, which tore the
   label/field pairs apart, and an inert row-gap on a display: block
   vertical box). */
#SelectCertificateDialog #box1 {
	display: flex !important;
	flex-direction: column;
	gap: var(--spacing-m);
	min-width: 46em;
}
#SelectCertificateDialog #searchbox-hbox,
#SelectCertificateDialog #dialog-hbox1 {
	display: flex !important;
	align-items: center;
	gap: var(--spacing-m) !important;
}
#SelectCertificateDialog #searchbox-hbox > label,
#SelectCertificateDialog #dialog-hbox1 > label {
	flex: 0 0 auto;
	width: auto !important;
	/* shared label column, so the two fields align */
	min-width: 6em;
	text-align: start !important;
}
#SelectCertificateDialog #searchbox-hbox #searchbox,
#SelectCertificateDialog #dialog-hbox1 #description.ui-edit-container {
	flex: 1 1 auto;
}
#SelectCertificateDialog #searchbox-hbox input,
#SelectCertificateDialog #dialog-hbox1 input {
	width: 100%;
	box-sizing: border-box;
}
/* The certificate list: the cell text has to be fully readable (this is
   about document signing), so wrap it instead of truncating, and scroll
   vertically. The minmax() bounds let the fr maxima fill the available
   width exactly, so nothing overflows horizontally. */
#SelectCertificateDialog .ui-treeview {
	grid-template-columns: minmax(8em, 2fr) minmax(8em, 2fr) minmax(3em, auto) minmax(6em, auto)
		minmax(6em, 1fr) !important;
	max-width: 60em;
	max-height: 20em;
	overflow-y: auto;
	overflow-x: hidden;
}
#SelectCertificateDialog .ui-treeview .ui-treeview-entry > div,
#SelectCertificateDialog .ui-treeview .ui-treeview-headers > div {
	white-space: normal !important;
	overflow-wrap: anywhere;
}
/* The header cells have a 16px sort-indicator padding on a content-box,
   which made each header overflow its subgrid track and produced a
   permanent horizontal scrollbar. */
#SelectCertificateDialog .ui-treeview-headers > .ui-treeview-header {
	box-sizing: border-box;
}
#SelectCertificateDialog #box1 > .ui-grid-cell:last-child {
	display: flex !important;
	justify-content: flex-end;
	gap: var(--spacing-m) !important;
}

#AcceptRejectChangesDialog .ui-treeview-headers {
	position: sticky;
	top: 0;
	background-color: var(--color-background-lighter) !important;
	z-index: 1;
}


/* New Table Style dialog: the online layout does not apply the .ui size hints,
   so size the region list to show all its rows, widen the picker column so its
   labels and colour dropdowns are not cut off, and put a gap before that
   column. */
#NewTableStyleDialog #regions.ui-treeview {
	max-height: 300px;
}

#NewTableStyleDialog #pickergrid {
	min-width: 380px;
}

/* The colour dropdowns fill their grid cell but also carry a side margin, which
   pushes them past the cell (and the dialog) edge and clips them. Drop the
   margin; the grid column gap still separates them from the labels. */
#NewTableStyleDialog :is(#backcolor, #fontcolor, #bordercolor) {
	margin-inline: 0;
}

#NewTableStyleDialog #editbox {
	column-gap: 12px;
}

/* Certificate dialogs: size columns to their content and keep headers aligned
   with rows via subgrid (as the Chart Data table does). min-content (not auto)
   tracks so empty/unused columns collapse and stretch can't inflate them. */
#SelectCertificateDialog #signatures.ui-treeview,
#DigitalSignaturesDialog #signatures.ui-treeview {
	overflow-x: auto;
	/* width:100% + the 1px border and padding overflow the container under the
	   default content-box, clipping the right border; include them in the width. */
	box-sizing: border-box;
	/* both, so column 1 (the explicit track) and 2+ (implicit) are all
	   non-stretchable - otherwise the lone auto track absorbs all the slack from
	   justify-content:stretch and stays wide. */
	grid-template-columns: min-content;
	grid-auto-columns: min-content;
}

/* Select Certificate's usage column can make the table too wide, so let it
   shrink and scroll horizontally. */
#SelectCertificateDialog #signatures.ui-treeview {
	min-width: 0;
}

/* Trailing space so adjacent columns (esp. header labels) don't touch... */
#SelectCertificateDialog .ui-treeview-headers > div,
#SelectCertificateDialog .ui-treeview-entry > div,
#DigitalSignaturesDialog .ui-treeview-headers > div,
#DigitalSignaturesDialog .ui-treeview-entry > div {
	padding-inline-end: 1rem;
}

/* ...but not on the icon column or columns empty in both header and body, so
   those collapse instead of leaving a gap. */
#SelectCertificateDialog .ui-treeview-entry > .ui-treeview-icon-column,
#SelectCertificateDialog .ui-treeview-headers > div:has(.ui-treeview-header-text:empty),
#SelectCertificateDialog .ui-treeview-entry > div:has(.ui-treeview-cell-text-content:empty),
#DigitalSignaturesDialog .ui-treeview-entry > .ui-treeview-icon-column,
#DigitalSignaturesDialog .ui-treeview-headers > div:has(.ui-treeview-header-text:empty),
#DigitalSignaturesDialog .ui-treeview-entry > div:has(.ui-treeview-cell-text-content:empty) {
	padding-inline-end: 0;
}

/* Data cells default to display:table-cell, which sizes to their own content and
   ignores the grid track, so they overflow their (collapsed) tracks and widen the
   table. Make them block so each fills its column track exactly. */
#SelectCertificateDialog .ui-treeview-entry > div,
#DigitalSignaturesDialog .ui-treeview-entry > div {
	display: block;
	width: auto;
}

/* The status-icon column is fixed at 30px by the base rule, which keeps the first
   column wide even when the icon is hidden. Let it size to its icon instead, so it
   collapses when there's no icon. */
#SelectCertificateDialog .ui-treeview div.ui-treeview-icon-column,
#DigitalSignaturesDialog .ui-treeview div.ui-treeview-icon-column {
	width: auto;
}

.jsdialog.one-child-popup:not(.ui-iconview) {
	border: 0;
	margin: 0 !important;
	padding: 0 !important;
}

div#autoFillPreviewTooltip {
	min-width: fit-content;
	max-width: fit-content;
}

div#autoFillPreviewTooltip .lokdialog.ui-dialog-content.ui-widget-content {
	padding: 0em 0.2em;
}

.jsdialog-window.modalpopup:not(.snackbar),
.hyperlink-pop-up-container {
	min-width: 198px;
	border: 1px solid var(--color-border-darker) !important;
	border-radius: var(--border-radius);
	box-shadow: var(--shadow-subtle);
	overflow: auto;
	position: relative;
	margin: auto;
	max-height: calc(100% - 30px);
}

#modal-dialog-about-dialog-box,/* Overwrite .jsdialog-window.modalpopup width */
#modal-dialog-online-help-content-box,/* help */
#modal-dialog-keyboard-shortcuts-content-box /* Keyboard shortcuts */ {
	max-width: 94%; /* Safe guard for when window is too small */
	width: 754px;
}

.jsdialog-window.modalpopup .jsdialog-container {
	position: relative;
}

.jsdialog-container .ui-dialog-titlebar {
	background-color: var(--color-background-lighter);
}

/* Draw close "X" icon with SVG instead of bitmap sprite.
   Branding layers override this background-image via higher specificity. */
.ui-dialog-titlebar-close .ui-icon-closethick {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M3 3 L13 13 M13 3 L3 13' stroke='%23222' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
	background-position: center;
	background-size: 16px 16px;
}

[data-theme='dark'] .ui-dialog-titlebar-close .ui-icon-closethick {
	filter: invert(1);
}

.ui-dialog-titlebar-close:focus-visible {
	outline: 2px solid var(--color-primary, #005a9c);
	outline-offset: 1px;
	border-radius: 2px;
}

.jsdialog-container .ui-dialog-content {
	max-height: calc(0.9 * var(--dialog-available-height) - 34px);
	overflow-y: auto !important;
	background-color: var(--color-background-lighter) !important;
	font-family: var(--cool-font);
	line-height: 1.5;
	scrollbar-color: var(--scrollbar-color);
	scrollbar-width: var(--scrollbar-width);
}
[data-docType='spreadsheet'] .jsdialog-container .ui-dialog-content,
[data-docType='text'] .jsdialog-container .ui-dialog-content {
	max-height: calc(0.9 * var(--dialog-available-height) - 98px);
}
#SortKeyWindow {
	/* As used in .jsdialog-container .ui-dialog-content 90 % of the viewport
	   minus 352px:
		- 34px the dialog's header
		- 112px the next sibling
		- 50px the dialog's buttons
		- 80px status bar and calc sheet bar
		- 38px formulabar
		- 38px document-header
   */
	max-height: calc(0.9 * var(--dialog-available-height) - 352px);
}

.jsdialog-container .ui-dialog-content > div:not(.ui-scrollwindow) {
	overflow: hidden; /* don't inherit scrollbar from parent */
}

/* Security Label dialog: cap the category list so it -- and only it -- scrolls, never
   the whole dialog, however many categories the policy has. Its container is sized with
   max-height, so the vexpand grid row has no definite height to resolve against, and the
   list grows to its full content unless capped here. Like .ui-dialog-content, the cap
   follows the space the dialog has; the reserve leaves room for the marking banner above,
   the policy and classification rows and the (wrapping) warning below; tune it if those
   grow. */
#SecurityLabelDialog #categorieswin {
	max-height: calc(0.9 * var(--dialog-available-height) - 28rem);
	overflow-y: auto;
}

/* Wider than the 400px every dialog gets, so the error and warning lines and the category
   names wrap less, and never wider than a narrow window. */
#SecurityLabelDialog #contentbox {
	min-width: min(36rem, 90vw);
}

/* The error about what of the policy the dialog cannot show leads the dialog: bold, in the
   theme's error colour (a dark red, or a light red in dark mode), with a bar of that colour
   beside it. The label renders as a span, hence the display; its lines are separated by
   newlines. */
#SecurityLabelDialog #seclabeloverflow {
	display: block;
	padding-inline-start: 8px;
	border-inline-start: 3px solid var(--color-status-error);
	color: var(--color-status-error);
	font-weight: bold;
	white-space: pre-line;
}

/* The marking preview is a banner atop the dialog, styled like the one the document
   gets (#security-label-banner), so it stands out from the form below it. The label
   renders as a span, hence the display/width; the dialog hides it when there is no
   marking to show. */
#SecurityLabelDialog #preview {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 4px 8px;
	text-align: center;
	font-weight: bold;
	background-color: var(--security-banner-background, rgb(var(--doc-type, 3, 105, 163)));
	color: var(--security-banner-color, var(--color-background-lighter));
}

@media (max-width: 480px) {

	body:not(.jsdialog-popout-body)
	.jsdialog-container
	.ui-dialog-content > div:not(.ui-scrollwindow) {
		overflow: unset;
	}
}


.jsdialog-container .lokdialog.ui-dialog-content.ui-widget-content {
	overflow: hidden;
}

.jsdialog.vertical label, .ui-frame-label, #ui-color-picker-recent-label, #ui-color-picker-custom-label {
	margin: auto 0px;
	color: var(--color-main-text);
	font-size: var(--default-font-size);
	line-height: var(--default-height);
	padding-left: inherit;
}

@media (max-width: 480px) {

	body:not(.jsdialog-popout-body)
	.jsdialog-container
	.lokdialog.ui-dialog-content.ui-widget-content {
		overflow-x: unset;
	}
}


#glowframe > div.ui-frame.jsdialog.sidebar > label,
#softedgeframe > div.ui-frame.jsdialog.sidebar > label {
	color: var(--color-main-text);
	font-size: var(--header-font-size);
	line-height: var(--header-height);
	margin: var(--spacing-s);
}

#accessibilityCheckBox .jsdialog.ui-text {
	margin: 0;
	padding-inline-end: 112px;
	color: var(--color-main-text);
	font-size: var(--default-font-size);
	text-transform: none;
}

*:not(.modalpopup) > .lokdialog_container.ui-dialog.ui-widget-content, .autofilter-container {
	border: 1px solid var(--color-border-darker);
	box-shadow: 0 0 3px var(--color-border-darker);
	border-radius: var(--border-radius);
	background: var(--color-background-darker);
}

.jsdialog.row {
	display: table-row;
}

.jsdialog.cell {
	display: table-cell;
	vertical-align: middle;
}

.jsdialog.vertical:not(.sidebar):not(.ui-separator) {
	width: 100%;
}

th.jsdialog:not(:first-child) {
	padding-inline-end: 24px;
}

th.jsdialog {
	text-align: start;
}

.jsdialog.vertical:not([id^='table-dialog-action_area']) > .jsdialog.row,
td.jsdialog > [id^='table-box']:not(.sidebar) {
	display: table;
	width: 100%;
}

.jsdialog.ui-alignment {
	margin: 0px;
	display: block;
}

.ui-grid {
	border-spacing: 0px;
	width: 100%;
	display: grid;
	grid-gap: var(--spacing-s);
	align-items: center;
}

/* Special Characters dialog */
#SpecialCharactersDialog #viewgrid,
#SpecialCharactersDialog #favgrid {
	grid-gap: var(--spacing-s);
	width: fit-content;
}

/* Find and replace dialog */
#search_grid, #replace_grid {
	grid-template-columns: minmax(100px, min-content) auto !important;
}
#searchframe input[type='checkbox'] {
	margin-inline-start: 0;
}

/* keep structure with hidden elements correct */

.ui-grid > .hidden {
	visibility: hidden;
	display: initial !important;
	/* don't occupy space showing empty area */
	width: 0px !important;
	height: 0px !important;
	min-width: 0px !important;
	min-height: 0px !important;
	margin: 0px !important;
	padding: 0px !important;
	flex-grow: initial !important;
}

/* Page number dialog placed under Insert menu */
#PageNumberDialog #rightVBox,
#PageNumberDialog #leftVBox {
	display: flex;
	flex-direction: column;
	margin: 5px;
}

/* Scrollwindow - used eg. in accessibility check in writer */
.jsdialog.ui-scrollwindow:not(.formulabar) {
	overflow: auto;
	max-height: 500px;
	max-width: 650px;
	scrollbar-width: var(--scrollbar-width);
	scrollbar-color: var(--scrollbar-color);
}
/* - Also used in SpellingDialog where suggestion come in form
     of an image*/
.jsdialog.ui-scrollwindow.has-ui-drawing-area {
	width: max-content;
}

/* AccessibilityCheckDialog hack to prevent huge height in Firefox */
#AccessibilityCheckDialog .cell {
	vertical-align: unset !important;
}

/* Separator */

.jsdialog:focus-visible + .jsdialog.ui-separator.vertical {
	background-color: transparent;
}
.jsdialog.ui-separator.vertical {
	margin: 5px 0px;
	background-color: var(--color-background-darker);
}

[data-userinterfacemode='classic'] #toolbar-up .jsdialog.ui-separator.vertical {
	opacity: 0.4;
}

.ui-toolbar .ui-separator.vertical {
	height: 14px;
	width: 1px;
	padding: 0px; /* Set padding to 0px, as the padding in `browser/css/toolbar.css` overrides it for the separator. */
	align-self: center;
	margin: 0 3px;
}

.jsdialog.ui-separator.horizontal {
	margin: 0px;
	background-color: var(--color-border-lighter);
	border: none;
	height: 1px;
}

/* Badge */
.ui-badge {
	padding: 5px !important;
	background-color: var(--color-background-darker);
	color: var(--color-text-darker);
	border-width: 0px;
	border-radius: var(--border-radius);
	font-family: var(--cool-font);
	font-size: var(--default-font-size);
	font-weight: normal;
}

#toolbar-down .ui-separator.vertical {
	background-color: var(--color-status-badge);
	opacity: 0.2;
}

#toolbar-down .ui-badge,
#toolbar-down .unolabel {
	font-family: var(--cool-font);
	font-size: var(--default-font-size) !important;
	color: var(--color-status-badge) !important;
}

#toolbar-down .ui-badge:hover,
#toolbar-down .menubutton:hover .unolabel {
	color: var(--color-main-text) !important;
}

#toolbar-down .unoarrow {
	border-top-color: var(--color-status-badge);
}

#toolbar-down .menubutton:hover .unoarrow {
	border-top-color: var(--color-main-text);
}

#toolbar-down .unoSignature .unobutton:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
	border-radius: var(--border-radius);
}

/* Tabs */

.ui-tabs-content.jsdialog {
	display: grid;
}

.ui-tabs-content.jsdialog > .ui-content {
	grid-row: 1;
	grid-column: 1;
	display: flex;
	justify-items: stretch;
	align-items: stretch;
}

/* A page that is not the open one keeps the same layout as the open page, so the
   shared grid cell is as large as the largest page and keeps that size on a tab
   switch. */
.ui-tabs-content.jsdialog > .ui-content.hidden {
	display: flex !important;
	visibility: hidden;
}

.ui-tabpage.jsdialog {
	width: 100%;
	height: 100%;
}

.ui-overflow-manager > .notebookbar:not(.ui-separator),
.ui-overflow-manager:not(:has(.ui-overflow-group)) {
	box-sizing: border-box;
	/* same height as .hasnotebookbar > #toolbar-row */
	height: 82px;
}

/* ATTENTION the following declaration is targetting containers and childreen
 that have .horizontal.notebookbar. Ideally we would instead use:
.ui-overflow-manager > .horizontal.notebookbar so,
 buttons inside of grid are still center aligned but the sub container would be
algned to the bottom */
.ui-overflow-manager .horizontal.notebookbar {
	align-items: center;
}
.notebookbar.ui-overflow-group:not(.ui-overflow-group-container-with-label) {
	align-content: center;
	height: var(--notebookbar-element-height) !important;
	margin-bottom: 14px;
}

.ui-overflow-manager > .notebookbar.ui-iconview,
.ui-overflow-manager > .notebookbar.ui-treeview {
	/* fixes scrolling range, for example in #stylesview or Animations tab */
	align-content: initial;
}

.ui-overflow-manager > .notebookbar:not(.ui-separator):not(.ui-overflow-group):not(:has(.ui-overflow-group-container-with-label)) {
	height: var(--notebookbar-element-height);
	/* 14px extra margin for containers without label */
	margin-bottom: 14px;
}

.ui-overflow-manager > .notebookbar.vertical:not(.ui-separator) {
	height: var(--notebookbar-element-height) !important;
	margin-bottom: 14px !important;
}

#table-options .notebookbar.ui-overflow-group-inner,
.unotoolbutton.notebookbar.ui-content.has-label > *:not(.arrowbackground) {
	height: var(--notebookbar-element-height) !important;
	align-content: center;
}

.ui-overflow-manager .notebookbar.ui-overflow-group-container-with-label {
	justify-content: center;
}

/* Overflow dropdown highlighting */
.overflow-dropdown-active {
	background-color: rgba(var(--doc-type), 0.1) !important;
	border: 1px solid rgb(var(--doc-type)) !important;
	color: var(--color-text-dark) !important;
	border-radius: var(--border-radius) !important;
}

.ui-toggle button,
.ui-tab.jsdialog {
	float: left !important;
	font-size: var(--default-font-size) !important;
	font-family: var(--cool-font) !important;
	line-height: normal !important;
	color: dimgray !important;
	color: var(--color-text-dark) !important;
	height: var(--header-height) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center;
	padding: 0px 1em !important;
	border: solid 1px transparent !important;
	border-radius: var(--border-radius) !important;
	margin-inline-end: 12px !important;
	background-color: transparent !important;
	margin-block: 0 4px;
}

.ui-tab.hidden.jsdialog {
	visibility: hidden !important;
}

[data-theme='dark'] .ui-tab.selected.jsdialog {
	color: var(--color-main-text) !important;
}

.ui-toggle.checked button,
.ui-tab.selected.jsdialog {
	background-color: var(--color-background-lighter) !important;
	color: rgba(var(--doc-type), 1) !important;
	-webkit-text-decoration: underline 2px solid rgba(var(--doc-type), 1);
	        text-decoration: underline 2px solid rgba(var(--doc-type), 1);
	text-underline-offset: 6px;
}

.ui-tab.jsdialog:focus-visible {
	outline: 2px solid var(--color-primary-dark);
	outline-offset: -2px;
}

body button:not(.ui-corner-all):not(.button):not(.button-primary):not(.unobutton):not(.form-field-button):not(.notebookbar.ui-tab):not(.ui-expander-btn):not(.arrowbackground):not(.ui-combobox-button):not(.inserttable-grid .col):not(.spinfieldbutton-up):not(.spinfieldbutton-down):not(.slide-import-source-main):not([aria-disabled='true']):not(.snackbar *):hover {
	color: rgba(var(--doc-type), 1) !important;
	background-color: var(--color-background-darker) !important;
}

.ui-tab.jsdialog:not(.selected):not([aria-disabled='true']):hover {
	cursor: pointer !important;
}


/* Vertical tab rail: used when a dialog has more tabs than comfortably fit a
   horizontal row. The rail sits on the inline-start side and the panel fills
   the rest. Rail and panel share one grid row, so the root is as tall as the
   taller of the two: the rail stays fully visible even when the selected page
   is empty (e.g. the Area tab with fill "None"), and a tall page stretches the
   rail to its full height. The dialog measures each tab page from the panel to
   size itself, the same as in the horizontal layout. */

.ui-tabs-root.vertical {
	position: relative;
	display: grid;
	/* An auto column sizes the dialog to the widest page and still stretches
	   into free space; a fr column would not grow the dialog intrinsically. */
	grid-template-columns: var(--dialog-tab-rail-width) auto;
}

.ui-tabs.vertical.jsdialog.ui-widget {
	grid-row: 1;
	grid-column: 1;
	box-sizing: border-box;
	width: var(--dialog-tab-rail-width);
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow-y: auto;
	border-inline-end: 1px solid var(--color-border-lighter);
}

.ui-tabs-root.vertical > .ui-tabs-content.jsdialog {
	grid-row: 1;
	grid-column: 2;
	padding-left: 16px;
}

/* Keeps all elements in ui-treeview within the grid container */
.jsdialog .ui-treeview,
.jsdialog .ui-treeview.ui-grid-cell {
	box-sizing: border-box;
}

/* Shrinks the Search bar in #CharNamePage instead of overflowing */
#CharNamePage.jsdialog .ui-treeview.ui-grid-cell {
	grid-template-columns: minmax(0, 1fr) !important;
}

#CharNamePage.jsdialog {
	grid-template-columns: unset !important;
}

.ui-tabs.vertical .ui-tab.jsdialog {
	float: none !important;
	width: 100%;
	height: auto !important;
	min-height: var(--header-height);
	min-width: 0;
	justify-content: flex-start !important;
	text-align: start;
	padding-block: 6px !important;
	padding-inline: 8px !important;
	margin-inline-end: 0 !important;
	margin-block: 0 !important;
	/* Only the inline-start border carries the accent. The other three sides
	   have no border, so nothing miters into the accent and cuts its top and
	   bottom into slants. A transparent inline-start edge on every tab keeps
	   selecting one from shifting it sideways. */
	border-block: 0 !important;
	border-inline-end: 0 !important;
	border-inline-start: 3px solid transparent !important;
}

/* The title is a flex item of the tab button. Without this it keeps its
   content's natural width and overflows the fixed rail instead of wrapping. */
.ui-tabs.vertical .ui-tab.jsdialog .ui-tab-label {
	min-width: 0;
	white-space: normal;
	overflow-wrap: break-word;
}

/* Three classes, to beat the display that .ui-tab.jsdialog sets. */
.ui-tab.jsdialog.hidden {
	display: none !important;
}

.ui-tabs[aria-orientation='horizontal'] > .ui-tab:first-child:not(.hidden),
.ui-tabs[aria-orientation='horizontal'] > .ui-tab.hidden + .ui-tab {
	padding-inline-start: 0px !important;
}

/* Selected vertical tab: a left-edge accent bar replaces the underline that
   marks the selected tab in the horizontal row. */
.ui-tabs.vertical .ui-tab.selected.jsdialog {
	text-decoration: none;
	border-inline-start-color: rgba(var(--doc-type), 1) !important;
	border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
}

/* Expander */

.jsdialog.ui-linkbutton,
.jsdialog.ui-expander {
	box-shadow: 0 1px 0px 0 var(--color-border-lighter);
	background-color: transparent;
	border: none;
}

.ui-expander.jsdialog:not(.sidebar) {
	width: 100%;
	text-align: left;
	font-size: 14px;
	padding-bottom: 4px;
}

#options.ui-expander {
	margin-top: 8px;
}

.ui-expander-heading {
	margin: 0;
	padding: 0;
	font: inherit;
	display: contents;
}

.ui-expander-btn:focus:not(:focus-visible) {
	outline: none;
}

#technical-details-text {
	padding: 6px 8px;
}

#copy-error-details img {
	width: var(--btn-img-size);
}

.ui-expander-label {
	color: #666;
}

.ui-expander-label.jsdialog {
	font-family: var(--cool-font);
}

.ui-expander-label::before,
.ui-treeview-expandable.collapsed > div > .ui-treeview-expander::before,
.ui-treeview div[aria-expanded='false'] > div > .ui-treeview-expander::before {
	display: inline-block;
	content: 'V';
	color: transparent;
	margin-inline-end: 7px;
	background: transparent url('images/lc_menu_chevron.svg') no-repeat center;
	filter: brightness(0.5);
}

.ui-expander-label.expanded::before,
.ui-treeview-expandable:not(.collapsed) > div > .ui-treeview-expander::before,
.ui-treeview div[aria-expanded='true'] > div > .ui-treeview-expander::before {
	content: 'V';
	color: transparent;
	margin-inline-end: 7px;
	transform: rotate(90deg);
	background: transparent url('images/lc_menu_chevron.svg') no-repeat center;
	filter: brightness(0.5);
}

@supports (content: '' / '') {
	.ui-expander-label::before,
	.ui-treeview-expandable.collapsed > div > .ui-treeview-expander::before,
	.ui-treeview div[aria-expanded='false'] > div > .ui-treeview-expander::before,
	.ui-expander-label.expanded::before,
	.ui-treeview-expandable:not(.collapsed) > div > .ui-treeview-expander::before,
	.ui-treeview div[aria-expanded='true'] > div > .ui-treeview-expander::before {
		content: 'V' / '';
	}
}

.ui-expander-label::before,
.ui-treeview-expandable > div > .ui-treeview-expander::before,
.ui-treeview div[aria-expanded] > div > .ui-treeview-expander::before {
	transition: transform var(--duration-fast) var(--ease-standard);
}

[data-theme='dark'] .ui-expander-label::before,
[data-theme='dark'] .ui-treeview-expandable > div > .ui-treeview-expander::before,
[data-theme='dark'] .ui-treeview div[aria-expanded] > div > .ui-treeview-expander::before {
	filter: brightness(1);
}

.ui-treeview-expandable > div > .ui-treeview-expander::before,
.ui-treeview div[aria-expanded] > div > .ui-treeview-expander::before {
	margin-inline-end: 7px !important;
	display: inline-block;
	position: relative !important;
	cursor: pointer;
}

.ui-treeview-header-sort-icon::after {
	content: '\25BC';
	margin-inline-start: 7px;
	display: none;
}

.ui-treeview-header-sort-icon.up::after {
	transform: rotate(180deg);
	display: inline-block;
}

.ui-treeview-header-sort-icon.down::after {
	display: inline-block;
}

.ui-treeview-header-button {
	background: none;
	border: none;
	font: inherit;
	font-weight: bold;
	cursor: pointer;
	color: var(--color-main-text);
}

.ui-treeview-icon {
	height: var(--btn-img-size-s);
	width: var(--btn-img-size-s);
	margin-inline-end: 8px;
	vertical-align: middle;
}

.ui-expander-label.expanded {
	color: #444;
}

.ui-expander-content.expanded {
	display: block;
}

.ui-expander-content:not(.expanded) {
	display: none;
}

.ui-expander-content.expanded.expanding {
	animation: fade-in var(--duration-fast) var(--ease-out);
}

.ui-expander:hover {
	cursor: pointer;
}

.ui-expander-content > .root-container.jsdialog {
	margin: var(--spacing-s);
}

/* Link Button*/

.ui-linkbutton {
	color: var(--color-text-dark) !important;
}

.ui-linkbutton:hover {
	cursor: pointer;
	color: var(--color-text-light) !important;
}

/* TreeView */

.ui-treeview {
	display: grid;
	grid-template-columns: repeat(1, auto);
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	overflow-y: auto;
	overflow-x: hidden;
	max-width: 1000px;
	min-width: 150px;
	min-height: 100px;
	padding: 1px;
	padding-inline-end: 3px;
	color: var(--color-main-text);
	font-size: var(--default-font-size);
	line-height: var(--default-height);
	align-content: start;
	justify-content: stretch;
	scrollbar-width: var(--scrollbar-width);
	scrollbar-color: var(--scrollbar-color);
}

.ui-treeview:has(> .ui-treeview-search-container) {
	padding-top: 0;
	/* otherwise position: sticky will leave a gap. We can't top: -1 on the search container or it'll scroll... */
}

.ui-treeview-search-container {
	/* we're using position: sticky at all since as we don't want to nest this in
		 another div and we don't want to scroll offscreen... it's a little ugly, but I
		 didn't think position: fixed and margin hacks would go down any more nicely...
	*/
	position: sticky;
	top: 0;
	background-color: var(--color-background-lighter);

	/* margin-left and margin-right can counterbalance the .ui-treeview padding here */
	margin-left: -1px;
	margin-right: -1px;
	padding-left: 1px;
	padding-right: 1px;
}

[id^='ui-treeview-search-input'] {
	width: 100%;
	box-sizing: border-box;
}

#__MENU__.ui-treeview {
	min-height: min-content;
}

.ui-treeview * {
	border-radius: initial;
}

/* Only in dialogs. A list is as tall as the rows core asks for, plus its header if it has one.
   It takes at most 40% of the window, or less when the dialog would not fit in the window
   otherwise, so the list scrolls rather than the dialog, down to 150px. */
.jsdialog:not(.sidebar).ui-treeview {
	--treeview-header-rows: 0;
	--treeview-requested-height: calc(
		(var(--treeview-height-rows, 0) + var(--treeview-header-rows)) *
		(var(--default-height) + 2px)
	);
	--treeview-list-height: clamp(
		150px,
		var(--treeview-requested-height),
		var(--dialog-list-max-height, 40vh)
	);
	max-height: var(--treeview-list-height);
}

.jsdialog:not(.sidebar).ui-treeview:has(> .ui-treeview-headers) {
	--treeview-header-rows: 1;
}

.ui-treeview.disabled,
.ui-treeview-entry div.disabled,
.ui-treeview-entry.disabled {
	background-color: var(--color-background-dark) !important;
	color: var(--color-text-light) !important;
	pointer-events: none;
}

#custom_animation_label_parent {
	display: block;
	width: inherit;
}

.ui-treeview.empty {
	color: var(--color-text-light);
}

.ui-treeview-cell.with-sub-dialog {
	cursor: context-menu;
}

.ui-treeview-expandable.collapsed + .ui-treeview-expanded-content {
	display: none !important;
}

/* real tree requires spacing - inline-flex, headers require synchronized grid */
.ui-treeview:not(.ui-treeview-tree) .ui-treeview-entry,
.ui-treeview:not(.ui-treeview-tree) .ui-treeview-expanded-content {
	display: grid;
	grid-template-columns: subgrid;
}

.ui-treeview.ui-treeview-tree .ui-treeview-entry {
	display: inline-flex;
	width: 100%;
}

.ui-treeview-entry,
.ui-treeview-expanded-content {
	grid-auto-flow: column;
	/* grid-column: '1 / ' + (this._columns + 1) - set inside JS */
	justify-content: stretch;
	align-items: start;
	white-space: nowrap;
}

.ui-treeview-image {
	outline: 1px solid var(--color-btn-border);
	vertical-align: middle;
}

/* that rule is for custom rendering like font previews */
.ui-treeview-entry img.ui-treeview-image {
	border: 1px solid transparent;
	max-height: 24px; /* required for hidpi*/
}

#ServerAuditDialog .ui-treeview-entry {
	display: grid;
	grid-template-columns: var(--btn-img-size) 6fr 3fr;
	white-space: normal;
}

#ServerAuditDialog .ui-treeview-entry .ui-treeview-rowheader {
	min-width: 0;
	background-color: transparent;
}

.ui-treeview-expanded-content {
	display: grid;
}

.ui-treeview-entry > div.ui-treeview-expander-column {
	width: 20px !important; /* overwrite first-child rule */
}

.ui-treeview div.ui-treeview-icon-column {
	width: 30px; /* in table with headers has to be 100% */
}

.ui-treeview div.ui-treeview-icon-column img {
	max-width: 30px;
}

.ui-treeview div.ui-treeview-state-column {
	width: 38px;
}

.ui-treeview-headers {
	white-space: nowrap;
	display: grid;
	grid-auto-flow: column;
	/* grid-column: '1 / ' + (this._columns + 1) - set inside JS */
}

/* Each heading sits over its own column, with a gap between the columns */
.ui-treeview:not(.ui-treeview-tree) > .ui-treeview-headers {
	grid-template-columns: subgrid;
}

.ui-treeview:not(.ui-treeview-tree):has(> .ui-treeview-headers) {
	column-gap: var(--spacing-m);
}

.ui-treeview-toggle-columns .ui-treeview-toggle-column {
	text-align: center;
	padding-inline: var(--spacing-s);
}

/* Even when it is the first cell of the row, which is otherwise as narrow
   as its content */
.ui-treeview-toggle-columns .ui-treeview-entry > div.ui-treeview-toggle-column {
	width: 100%;
	justify-content: center;
}

#ServerAuditDialog .ui-treeview-headers {
	display: grid;
	grid-column-end: 4 !important;
	grid-template-columns: 0fr 6fr 3fr;
	margin-inline-start: 4px;
}

#ServerAuditDialog .ui-treeview-headers div.ui-treeview-icon-column {
	width: 0px /* prevent display of ui-treeview-icon-column in ui-treeview-header */
}

#ServerAuditDialog .ui-treeview-headers > div:nth-last-child(1) {
	margin-inline-start: 7px;
}

.ui-treeview-header {
	display: inline-block;
	width: 100%;
}

.ui-treeview-header-color {
	height: 4px;
	width: 100%;
	border-radius: 1px;
}

.ui-treeview-header-text {
	font-weight: bold;
}

#ChartDataDialog .ui-treeview-rowheader {
	font-weight: bold;
	text-align: center;
	background-color: var(--color-background-dark);
	width: 100% !important;
	min-width: 3em;
	box-sizing: border-box;
}

.ui-treeview-entry > div {
	display: table-cell;
	width: 100%;
}

.ui-treeview-entry div:first-child {
	display: flex;
	width: min-content;
	justify-content: start;
}

.ui-treeview-entry div:last-child {
	display: flex;
	width: 100%;
	justify-content: start;
}

.ui-treeview-entry div:not(.autofilter) {
	padding-inline-start: 2px;
	margin-inline-end: 2px;
}

.ui-treeview.disabled .ui-treeview-entry div:not(.autofilter) {
	background-color: var(--color-background-dark);
}

input[type='checkbox'].autofilter, .jsdialog input[type='checkbox'] {
	appearance: none;
	width: 20px;
	height: 20px;
	vertical-align: middle;
	background: url('images/lc_checkboxoff.svg') no-repeat center;
	margin: 1px 8px;
}

[data-theme='dark'] input[type='checkbox'].autofilter, [data-theme='dark'] .jsdialog input[type='checkbox'] {
	background: url('images/dark/lc_checkboxoff.svg') no-repeat center;
}

input[type='checkbox']:checked.autofilter, .jsdialog input[type='checkbox']:checked {
	border-color: transparent;
	background-image: url('images/lc_checkbox.svg');
}

[data-theme='dark'] input[type='checkbox']:checked.autofilter, [data-theme='dark'] .jsdialog input[type='checkbox']:checked {
	background-image: url('images/dark/lc_checkbox.svg');
}

.ui-treeview-entry div span {
	width: 100%;
}

.ui-treeview-entry div.mobile-wizard {
	line-height: 40px;
	padding-left: 10px;
	padding-right: 10px;
}

#ChartDataDialog .ui-treeview-entry:focus-visible {
	outline: none;
}

.ui-treeview-entry.selected {
	background-color: var(--color-primary);
	color: var(--color-text-darker);
	border: 1px solid var(--color-primary);
}

.ui-treeview.disabled .ui-treeview-entry.selected {
	background-color: var(--color-background-darker) !important;
}

.ui-treeview-entry:hover {
	background-color: var(--color-background-darker) !important;
	color: var(--color-text-darker);
	border: 1px solid var(--color-background-darker);
}

.ui-treeview-entry {
	border: 1px solid transparent;
}

#mobile-wizard tbody input[type='checkbox'] {
	float: none;
	vertical-align: middle;
}

.ui-treeview.droptarget {
	border: 1px solid #888;
}
.ui-treeview.droptarget:hover {
	border: 1px solid #888;
	box-shadow: 0 0 2px 0 #777;
}

/* tree grid */

.ui-treeview div[aria-level='1'] + .ui-treeview-expanded-content > .ui-treeview-entry {
	padding-left: 2.5ch;
	width: auto;
}

.ui-treeview div[aria-level='2'] + .ui-treeview-expanded-content > .ui-treeview-entry {
	padding-left: 3.5ch;
	width: auto;
}

.ui-treeview div[aria-level='3'] + .ui-treeview-expanded-content > .ui-treeview-entry {
	padding-left: 4.5ch;
	width: auto;
}

.ui-treeview div[aria-level='4'] + .ui-treeview-expanded-content > .ui-treeview-entry {
	padding-left: 5.5ch;
	width: auto;
}

.ui-treeview div[aria-level='5'] + .ui-treeview-expanded-content > .ui-treeview-entry {
	padding-left: 6.5ch;
	width: auto;
}

/* A tree with headers keeps a nested row on the columns of the headers. The row is indented
   inside its first column, and its expander moves by as much past the narrow expander column,
   drawn over the indent of the first column. */
.ui-treeview:has(> .ui-treeview-headers) div.ui-treeview-expanded-content > div.ui-treeview-entry {
	padding-left: 0;
}

.ui-treeview:has(> .ui-treeview-headers) .ui-treeview-entry[aria-level='2'] {
	--treeview-indent: 2.5ch;
}

.ui-treeview:has(> .ui-treeview-headers) .ui-treeview-entry[aria-level='3'] {
	--treeview-indent: 4.5ch;
}

.ui-treeview:has(> .ui-treeview-headers) .ui-treeview-entry[aria-level='4'] {
	--treeview-indent: 6.5ch;
}

.ui-treeview:has(> .ui-treeview-headers) .ui-treeview-entry[aria-level='5'] {
	--treeview-indent: 8.5ch;
}

.ui-treeview:has(> .ui-treeview-headers) .ui-treeview-entry > .ui-treeview-expander-column {
	position: relative;
	left: var(--treeview-indent, 0);
}

.ui-treeview:has(> .ui-treeview-headers) .ui-treeview-entry > .ui-treeview-expander-column + div {
	padding-left: var(--treeview-indent, 0);
}

.ui-treeview div.ui-treeview-expander {
	vertical-align: top;
	justify-content: end;
}

/* context menu */
.context-menu-root:focus {
	outline: none;
}
.context-menu-list {
	background: var(--color-background-lighter);
	border: 1px solid var(--color-border-dark);
	border-radius: var(--border-radius);
	box-shadow: var(--shadow-subtle);
}

.context-menu-item {
	color: var(--color-main-text);
	background-color: transparent;
	padding-left: 1em;
	font-size: var(--medium-font-size) !important;
}

.context-menu-separator {
	border-bottom: 1px solid var(--color-border-lighter);
}

.context-menu-item.context-menu-disabled {
	color: var(--color-text-light);
	background-color: var(--color-background-lighter);
}

.context-menu-item.context-menu-submenu::before {
	content: '';
}

.context-menu-item.context-menu-submenu::before,
.context-menu-icon-spacer,
img.context-menu-icon {
	width: 1rem;
	height: 1rem;
	margin-right: 8px;
	vertical-align: middle;
	display: inline-block;
}

/*
* Hide the spacer icon if the entire context menu list does not contain any <img>.
* This prevents unnecessary visual gaps when no icons are present.
*/
.context-menu-list:not(:has(img)) .context-menu-icon-spacer {
	display: none;
}

/*
 * Applies consistent spacing across all items in a mixed submenu.
 * 1. The entire context menu list has no <img> at all (icon-less menu)
 * 2. The submenu contains a checkmark but has no <img>
 * 3. The submenu contains a radio but has no <img>
 * 4. The submenu contains a checkmark and also contains <img>
 * 5. The submenu contains a radio and also contains <img>
 */
.context-menu-list:not(:has(img)) .context-menu-item,
.context-menu-submenu:has(.context-menu-icon-lo-checkmark):not(:has(img)) .context-menu-item,
.context-menu-submenu:has(.context-menu-icon-radio):not(:has(img)) .context-menu-item,
.context-menu-submenu:has(.context-menu-icon-lo-checkmark):has(img) .context-menu-item,
.context-menu-submenu:has(.context-menu-icon-radio):has(img) .context-menu-item {
	padding-left: 2em;
}

#statusbar-context-menu-dropdown.jsdialog-window {
	/* override width set in .jsdialog-window.modalpopup */
	min-width: 160px !important;
}

.ui-grid:has(.ui-combobox-entry.checked, .ui-combobox-entry.notchecked) .ui-combobox-entry:not(.checked):not(.notchecked)::before {
	content: '\2713';
	display: inline-block;
	visibility: hidden;
	padding: 0 6px;
}

.user-hidden {
	display: none !important;
}

/* input text */

.ui-dialog .jsdialog.ui-edit:focus-visible {
	outline-offset: -2px;
}

.jsdialog.ui-edit {
	color: var(--color-text-dark);
	background-color: var(--color-background-dark);
	line-height: 28px;
	max-height: 32px;
	width: auto;
	width: -webkit-fill-available;
	width: -moz-available;
	width: stretch;
	border: 1px solid var(--color-border-input-dark);
	border-radius: var(--border-radius);
	overflow: hidden;
	align-self: center;
	padding-inline: 4px;
}

/* The edit container is a grid cell and stretches to the row height, so its
   input would otherwise sit at the top. Center the input vertically so it
   lines up with the combo boxes and buttons beside it in the same row. */
.jsdialog-window .ui-edit-container {
	display: flex;
	align-items: center;
}

.ui-treeview-search-input.jsdialog.ui-edit {
	line-height: var(--default-height);
}

/* The user agent's own grey is 3.76:1 on this field's background. */
.ui-treeview-search-input::placeholder,
.template-search-input::placeholder {
	color: var(--color-text-dark);
	opacity: 1;
}

/* The placeholder goes as soon as there is text, so the field says what it is
   with the same glyph the combobox search beside it uses. */
.ui-treeview-search-input {
	background-image: url('images/lc_recsearch.svg');
	background-repeat: no-repeat;
	background-position: 8px center;
	background-size: 16px;
	padding-inline-start: 28px !important;
}

[data-theme='dark'] .ui-treeview-search-input {
	background-image: url('images/dark/lc_recsearch.svg');
}

[dir='rtl'] .ui-treeview-search-input {
	background-position: right 8px center;
}
.autofilter .ui-treeview-search-input.jsdialog.ui-edit,
.autofilter .ui-treeview-search-input.jsdialog.ui-edit:hover {
	width: 100%;
	width: -webkit-fill-available;
	width: -moz-available;
	width: stretch;
	margin-top: 8px;
	border-radius: 0;
	border-left: none;
	border-right: none;
}

.autofilter #list.ui-treeview {
	max-height: 250px;
}

.autofilter #list.ui-treeview,
.modalpopup #check_list_box.ui-treeview {
	min-height: inherit !important;
}
/* checkbox */

.jsdialog.checkbutton {
	white-space: nowrap;
	display: flex;
	margin: 0;
	align-items: center;
}

.jsdialog.checkbutton input,
.jsdialog.checkbutton label {
	vertical-align: middle;
	font-size: var(--default-font-size);
}

.jsdialog.checkbutton label {
	padding: 0px 2px;
	line-height: 28px;
	color: var(--color-main-text);
}
/* Radio button */

.ui-radiobutton,
.radiobutton.jsdialog {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

.jsdialog input[type='radio']:not(.ui-color-picker-entry) {
	margin: 1px 8px;
	border: none;
	height: 18px;
	width: 20px;
	display: block;
}

.ui-radiobutton > label,
.jsdialog .radiobutton > label {
	vertical-align: middle;
	white-space: nowrap;
}

/* the disabled attribute is set to 'disabled' when the widget is built and
   to 'true' by the runtime enable / disable actions, so match on presence */
.jsdialog input[type='radio'][disabled] ~ label {
	color: var(--color-text-light);
}

.jsdialog input[type='checkbox'][disabled] ~ label {
	color: var(--color-text-light);
}

/* text label */

.ui-dialog-content .jsdialog.ui-text {
	padding-inline-start: 0;
}

/* The Show Sheets list in the desktop dialog scrolls on its own, so the buttons stay in view. */
#hidden-parts-container.jsdialog {
	max-height: 300px;
	overflow-y: auto;
}

.jsdialog.ui-text {
	padding-inline-start: 8px;
}

.jsdialog.ui-frame-label {
	font-weight: bold;
}

/* fieldset and legend - form grouping */

.jsdialog .ui-fieldset {
	border: none;
	padding-inline: 0;
	padding-block: 0;
}

.jsdialog .ui-legend {
	padding-inline: 0;
	font-weight: bold;
}

/* spinfield */

.spinfieldcontainer {
	display: flex;
	align-items: center;
	margin-inline-end: 5px;
	min-width: 70px;
	width: 100%;
	border: 1px solid var(--color-border-input-dark);
	border-radius: var(--border-radius);
	background: var(--color-background-dark);
	color: var(--color-text-dark);
	box-sizing: border-box;
	height: 28px;
}

.spinfieldcontainer:not([disabled]):hover {
	border: 1px solid var(--color-border-input);
	color: var(--color-text-darker);
	background-color: var(--color-background-lighter);
}

.ui-dialog .spinfieldcontainer:has(.spinfield:focus-visible) {
	outline: auto Highlight;
	outline: auto -webkit-focus-ring-color;
	outline-offset: -1px;
}

.jsdialog.spinfieldcontainer[disabled] {
	border: 1px solid var(--color-border-lighter);
	color: var(--color-text-light);
	background: var(--color-background-lighter);
}

.spinfield {
	flex: 1;
	width: 0;
	min-width: 0;
	padding: 0;
	padding-inline-start: 4px;
	height: 100%;
	box-sizing: border-box;
	border: none;
	background: transparent;
	color: inherit;
	outline: none;
}

.jsdialog.ui-slider {
	width: 100%;
	margin: 0;
	accent-color: var(--color-primary);
}

.jsdialog.ui-slider:disabled {
	opacity: 0.5;
}

.spinfieldbuttons {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	flex-shrink: 0;
}

.spinfieldbutton-up,
.spinfieldbutton-down {
	border: none;
	background: none;
	padding: 0 4px;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.spinfieldbutton-up::after,
.spinfieldbutton-down::after {
	content: '';
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
}

.spinfieldbutton-up::after {
	border-bottom: 5px solid var(--color-text-light);
}

.spinfieldbutton-down::after {
	border-top: 5px solid var(--color-text-light);
}

.spinfieldcontainer:not([disabled]):hover .spinfieldbutton-up::after {
	border-bottom-color: var(--color-text-dark);
}

.spinfieldcontainer:not([disabled]):hover .spinfieldbutton-down::after {
	border-top-color: var(--color-text-dark);
}
/* listbox */
.ui-listbox-container,
.ui-combobox {
	display: flex;
	margin: auto 0;
	align-items: center;
	box-sizing: border-box;
	height: 24px;
	min-width: 70px;
}

.ui-combobox.ui-combobox-rendered-value {
	position: relative;
}

.ui-combobox.ui-combobox-rendered-value > input.ui-combobox-content {
	/* the rendered preview carries the name; hide the duplicate text */
	color: transparent;
}

img.ui-combobox-value-preview {
	position: absolute;
	inset-inline-start: 6px;
	top: 1px;
	bottom: 1px;
	height: calc(100% - 2px);
	max-width: calc(100% - 28px);
	object-fit: contain;
	object-position: left center;
	pointer-events: none;
}

.ui-listbox-container {
	height: 32px;
}

.ui-listbox {
	padding: 0 14px 0 4px;
	border: 1px solid var(--color-border-dark);
}

.ui-listbox,
.ui-combobox,
.ui-timefield {
	box-sizing: border-box;
	appearance: none;
	height: 1.5rem;
	line-height: normal;
	font-size: var(--default-font-size);
	font-family: var(--cool-font);
	border-radius: var(--border-radius);
	background-color: var(--color-background-dark);
	color: var(--color-text-dark);
}

.jsdialog-window .ui-listbox,
.jsdialog-window .ui-combobox,
.jsdialog-window .ui-timefield {
	height: 32px;/* Use the same height as in .jsdialog.ui-edit */
	min-width: 50px;
	width: 100%;
}

/* The minimum above is meant for the value a box shows. A combobox spends part of its
   width on the dropdown button, so it carries that minimum on its text field and the
   button adds its own width on top of it. */
.jsdialog-window .ui-combobox {
	min-width: auto;
}

.jsdialog-window .ui-combobox-content {
	min-width: 50px;
}

.jsdialog .ui-combobox {
	line-height: 22px;
}

.ui-listbox option {
	font-weight: normal;
	display: block;
	white-space: nowrap;
	min-height: 1.2em;
	padding: 0 5px;
}

.ui-listbox::-ms-expand {
	display: none;
}

/* Where possible (Chromium) make the select widgets use the customizable
   select (appearance: base-select) so the option list is styleable DOM.

   The plain control's option list is an OS-native menu that cannot be themed,
   so on macOS its highlighted option can fall below the accessibility contrast
   guidelines.

   Browsers without base-select keep the plain native control. */

/* stylelint does not know the ::picker pseudo yet. */
/* stylelint-disable selector-pseudo-element-no-unknown */
.ui-listbox,
.ui-listbox::picker(select) {
	appearance: base-select;
}
/* stylelint-enable selector-pseudo-element-no-unknown -- turn the check back on */

@supports (appearance: base-select) {
	/* base-select lays the closed control out as inline flex, so this centres
	   the text. Setting display here breaks the picker. */
	.ui-listbox {
		align-items: center;
		/* Keep the selected value on one line and cut it off at the end padding, so a long
		   value stays inside the box and clear of the arrow, as the plain control does. The
		   option list opens in the top layer, outside this box. */
		white-space: nowrap;
		overflow: clip;
		overflow-clip-margin: content-box;
	}

	/* Make the picker match the combobox dropdown popup, which is a modalpopup dialog. */
	/* stylelint-disable selector-pseudo-element-no-unknown */
	.ui-listbox::picker(select) {
		/* the dialog content surface, from .jsdialog-container .ui-dialog-content */
		background-color: var(--color-background-lighter);
		/* the modalpopup frame border, from .jsdialog-window.modalpopup:not(.snackbar) */
		border: 1px solid var(--color-border-darker);
		/* the same modalpopup frame corner radius */
		border-radius: var(--border-radius);
		/* the same modalpopup frame shadow */
		box-shadow: var(--shadow-subtle);
		/* the dropdown content padding, from .modalpopup[id$='-dropdown'] .ui-dialog-content */
		padding: 0;
		/* the dropdown content scroll box, from .jsdialog-container .ui-dialog-content.
		   The list scrolls once it grows past this. Stating a height the browser can
		   resolve as soon as the list is drawn also settles its width there and then,
		   so the list opens at the width it goes on to keep. */
		max-height: calc(90vh - 34px);
	}

	/* Hide the browser marker; the app's own arrow span shows instead. */
	.ui-listbox::picker-icon {
		display: none;
	}
	/* stylelint-enable selector-pseudo-element-no-unknown -- see above */

	/* Match the dropdown row text, from .ui-combobox-entry span. A flex row,
	   so that the check mark can move to its end, see below. */
	.ui-listbox option {
		display: flex;
		align-items: center;
		padding: 5px;
		font-size: var(--default-font-size);
		font-family: var(--cool-font);
		color: var(--color-text-dark);
	}

	/* Match the selected row, .ui-combobox-entry.selected span (background
	   only). :checked and :focus cover whichever one marks the highlighted
	   option. */
	.ui-listbox option:checked,
	.ui-listbox option:focus {
		background-color: var(--color-background-darker);
	}

	/* Match the hovered row, .ui-combobox-entry:hover. It comes after the
	   selected rule so hover wins on a row that is also selected, like the
	   combobox. */
	.ui-listbox option:hover {
		background-color: var(--color-background-hover);
	}

	/* Show the check mark of the selected option at the end of the row. */
	/* stylelint-disable selector-pseudo-element-no-unknown */
	.ui-listbox option::checkmark {
		order: 1;
		margin-inline-start: auto;
		padding-inline-start: 16px;
		color: var(--color-primary);
	}
	/* stylelint-enable selector-pseudo-element-no-unknown -- see above */
}

/* Draw vector border as downwards arrow. */
.ui-listbox-arrow {
	width: auto !important;
	height: 0px;
	font-size: 0;
	line-height: 0;
	border: 4px solid transparent;
	border-top: 5px solid var(--color-main-text);
	display: inline-block !important;
	/* The negative start margin lays the arrow over the end of the box in front
	   of it. The two margins and the 8px the arrow is wide add up to zero, so
	   the arrow takes no width of its own in the row. */
	margin-inline-start: -12px;
	margin-inline-end: 4px;
	margin-top: 4px;
	cursor: pointer;
}

.ui-combobox .ui-listbox-arrow {
	margin-inline-start: 0;
	margin-inline-end: 0;
}

.ui-listbox[disabled] ~ .ui-listbox-arrow,
.ui-combobox[disabled] ~ .ui-listbox-arrow {
	opacity: 0.5;
	cursor: auto;
}

/* ui-combobox */
.ui-combobox,
.ui-timefield {
	border: 1px solid var(--color-border);
}

.ui-combobox-content {
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	border: none;
	border-start-start-radius: var(--border-radius);
	border-end-start-radius: var(--border-radius);
	color: var(--color-text-dark);
	background-color: var(--color-background-lighter);
	padding-inline: 5px;
}

.current-font-missing #fontnamecombobox > .ui-combobox-content {
	background-color: color-mix(in srgb, var(--color-warning) 40%, var(--color-background-lighter));
}

/* Similar to .arrowbackground, centers the vector dropdown arrow. */
.ui-combobox-button {
	box-sizing: border-box;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-inline-start: 1px solid var(--color-border);
	background-color: transparent;
	padding-inline: 10px;
	border: none;
}

.ui-combobox-button[disabled]:hover {
	background-color: transparent;
}

.ui-combobox-button:hover {
	cursor: pointer;
	border-left-color: transparent;
	background-color: var(--color-background-darker);
}

.ui-combobox-dropdown {
	position: absolute;
	z-index: 2001;
	padding: 0px;
	overflow-y: auto;
	max-height: 500px;
	background-color: var(--color-background-dark);
	border: 1px solid var(--color-border-dark);
	border-radius: var(--border-radius);
}

.modalpopup[id$='-dropdown'] {
	/* submenu is inserted into the same overlay, don't make it relative to parent */
	position: absolute !important;
}

.modalpopup[id$='-dropdown'] .ui-dialog-content {
	padding: 0px;
}

.modalpopup[id$='-dropdown'] .ui-grid {
	grid-gap: 0px;
}

.ui-combobox-search-container {
	position: sticky;
	top: 0;
	z-index: 1;
	background-color: var(--color-background-lighter);
	padding: var(--spacing-s);
}

.ui-combobox-search-input {
	width: 100%;
	box-sizing: border-box;
	line-height: var(--default-height);
	background-image: url('images/lc_recsearch.svg');
	background-repeat: no-repeat;
	background-position: 8px center;
	background-size: 16px;
	padding-inline-start: 28px !important;
}

[data-theme='dark'] .ui-combobox-search-input {
	background-image: url('images/dark/lc_recsearch.svg');
}

[dir='rtl'] .ui-combobox-search-input {
	background-position: right 8px center;
}

.ui-combobox-search-input::placeholder {
	color: var(--color-text-dark);
	opacity: 1;
}

.ui-combobox-entry {
	width: calc(100% + 15px); /* + padding for scrollbar */
	display: flex;
	align-items: center;
}

.ui-combobox-entry:hover {
	background-color: var(--color-background-hover);
}

/* The menu of a point to tie a connector to is short and has no scrollbar, so its entries are as
 * wide as the menu, and the ring of the focused entry lies inside the entry, where all of it is
 * seen. */
#tie-point-menu-entries .ui-combobox-entry {
	width: 100%;
}

#tie-point-menu-entries .ui-combobox-entry:focus-visible {
	outline-offset: -2px;
}

.ui-combobox-entry.disabled {
	opacity: 0.5;
	pointer-events: none;
}

.ui-combobox-entry.has-open-submenu {
	background-color: var(--color-background-hover);
}

/* Line width dropdown of the Shape tab: draw a preview line as thick as the
 * entry it labels */

.ui-combobox-entry[class*='ui-linewidth-'] {
	width: 100%;
	box-sizing: border-box;
	padding: 0 4px;
}

.ui-combobox-entry[class*='ui-linewidth-']::before {
	content: '';
	flex: 1 1 auto;
	min-width: 56px;
	margin-inline-end: 4px;
	background-color: currentColor;
	border-radius: 1px;
}

.ui-combobox-entry[class*='ui-linewidth-'] > span {
	flex: 0 0 auto;
	width: auto;
	text-align: center;
	padding: 4px 0;
	border: none;
}

.ui-combobox-entry[class*='ui-linewidth-'].selected:not(:hover):not(.checked):not(.notchecked) {
	background-color: var(--color-background-darker);
}

.ui-combobox-entry[class*='ui-linewidth-'].selected:not(:hover):not(.checked):not(.notchecked) > span {
	background-color: transparent;
}

.ui-combobox-entry.ui-linewidth-18::before { height: 1px; }
.ui-combobox-entry.ui-linewidth-28::before { height: 2px; }
.ui-combobox-entry.ui-linewidth-35::before { height: 3px; }
.ui-combobox-entry.ui-linewidth-53::before { height: 4px; }
.ui-combobox-entry.ui-linewidth-81::before { height: 6px; }
.ui-combobox-entry.ui-linewidth-106::before { height: 8px; }
.ui-combobox-entry.ui-linewidth-159::before { height: 11px; }
.ui-combobox-entry.ui-linewidth-212::before { height: 14px; }

.ui-combobox-entry.ui-linewidth-lastcustom::before {
	height: var(--ui-linewidth-preview-height, 0);
}

.modalpopup[id$='-dropdown']
.jsdialog.ui-separator.horizontal.ui-linewidth-section-separator {
	height: 2px;
	margin: 4px 0;
	background-color: var(--color-border);
}

[id^='comment-menu-'][id$='-entries'] .ui-combobox-entry:hover,
[id^='jsd-context-menu'][id$='-entries'] .ui-combobox-entry:hover,
[id^='comment-menu-'][id$='-entries'] .ui-combobox-entry.has-open-submenu,
[id^='jsd-context-menu'][id$='-entries'] .ui-combobox-entry.has-open-submenu {
	background-color: var(--color-background-darker) !important;
	color: var(--color-text-darker) !important;
}

/* A checked context menu entry shows a check mark at the end of its row, after
 * the shortcut. The sheet tab menu and the status bar menu show it the same
 * way. */
[id^='jsd-context-menu'][id$='-entries'] .ui-combobox-entry.context-menu-checked::after,
#spreadsheet-tab-menu-entries .ui-combobox-entry.context-menu-checked::after,
#statusbar-context-menu-entries .ui-combobox-entry.context-menu-checked::after {
	content: '\2713';
	flex-shrink: 0;
	margin-inline-start: auto;
	/* The same spacing as span.shortcut below: 16px from the text, and 20px
	 * at the end, because .ui-combobox-entry is 15px wider than the menu. */
	padding-inline: 16px 20px;
	color: var(--color-primary);
}
[id^='jsd-context-menu'][id$='-entries'] .ui-combobox-entry.context-menu-checked > span.shortcut {
	padding-inline-end: 0;
}
[id^='jsd-context-menu'][id$='-entries'] .ui-combobox-entry.context-menu-checked:has(> span.shortcut)::after {
	margin-inline-start: 0;
}

.ui-combobox-entry:has(> span.shortcut) > span:not(.shortcut) {
	width: auto;
}
.ui-combobox-entry > span.shortcut {
	margin-inline-start: auto;
	width: auto;
	padding-inline-start: 16px;
	/* Compensate for the 15px scrollbar-padding overflow on
	 * .ui-combobox-entry so the shortcut stays inside the visible area. */
	padding-inline-end: 20px;
	color: var(--color-text-light);
}

.ui-combobox-entry.selected:not(:hover):not(.checked):not(.notchecked) span,
.margin-item.selected {
	background-color: var(--color-background-darker);
}

.ui-combobox-entry span {
	border: 1px solid transparent;
	padding: 5px;
	display: block;
	width: 100%;
	font-size: var(--default-font-size);
	font-family: var(--cool-font);
	color: var(--color-text-dark);
}

.ui-combobox-entry.checked::before {
	content: '\2713';
	display: inline-block;
	color: var(--color-primary);
	padding: 0 6px;
}

.ui-combobox-entry.notchecked::before {
	content: '\2713';
	display: inline-block;
	visibility: hidden;
	padding: 0 6px;
}

.ui-combobox-icon {
	background-repeat: no-repeat !important;
	width: var(--btn-size);
	height: var(--btn-size);
}

/* these rules are for custom rendering like font previews */
.ui-combobox-entry img {
	border: 1px solid transparent;
	max-height: 24px; /* required for hidpi*/
}

/* Icon-only entries: show a 16x16 image centered in both directions and
 * shrink the row to the icon width so the dropdown does not leave a wide
 * empty column. */
.ui-combobox-entry.ui-combobox-notext {
	width: auto;
	justify-content: center;
}

.ui-combobox-entry.ui-combobox-notext > span {
	display: none;
}

.ui-combobox-entry.ui-combobox-notext img {
	width: 16px;
	height: 16px;
	max-height: 16px;
	padding: 16px;
}

/* This is needed in chart line properties jsdialog.
 * When every entry in a dropdown is icon-only, drop the parent-derived
 * minimum width (set inline as the menu button width) so the popup shrinks
 * to just the icons. */
.modalpopup[id$='-dropdown']:has(.ui-combobox-entry.ui-combobox-notext):not(:has(.ui-combobox-entry:not(.ui-combobox-notext))) {
	min-width: 50px !important;
}

/* Line-end arrow pickers: icon-only rows */
.ui-combobox-entry.ui-combobox-lineend {
	min-width: 0;
	justify-content: center;
}

.ui-combobox-entry.ui-combobox-lineend.selected:not(:hover) {
	background-color: var(--color-background-darker);
}

.ui-combobox-entry.ui-combobox-lineend.selected:not(:hover):not(.checked):not(.notchecked) span {
	background-color: transparent;
}

.ui-combobox-entry.ui-combobox-lineend.selected:not(.checked):not(.notchecked) img:not(:hover) {
	border-color: transparent;
}

.ui-combobox-entry.ui-combobox-lineend > span {
	color: transparent;
	display: inline-block;
	width: 2rem;
	min-height: 1rem;
	overflow: hidden;
	white-space: nowrap;
}

.ui-combobox-entry.ui-combobox-lineend img {
	width: auto;
	max-height: 24px;
	padding: 2px 8px;
}

/* the whole row is the hover target, so the preview is not outlined on its own */
.ui-combobox-entry.ui-combobox-lineend img:hover {
	border-color: transparent;
	filter: none;
}

.ui-combobox-entry.ui-combobox-lineend-whole > span {
	width: 100%;
}

.ui-combobox-entry.ui-combobox-lineend-whole img {
	width: 100%;
	min-width: 0;
	height: auto;
	max-height: 24px;
	padding: 2px 6px;
	box-sizing: border-box;
}

.modalpopup[id$='-dropdown']:has(.ui-combobox-entry.ui-combobox-lineend-whole) {
	width: 0 !important;
}

.ui-combobox.ui-combobox-whole-width-preview > img.ui-combobox-value-preview {
	inset-inline-start: 8px;
	width: calc(100% - 42px);
	max-width: none;
	top: 50%;
	bottom: auto;
	height: auto;
	transform: translateY(-50%);
	object-fit: fill;
}

.modalpopup[id$='-dropdown']:has(.ui-combobox-entry.ui-combobox-lineend):not(
:has(.ui-combobox-entry.ui-combobox-lineend-whole)
) {
	min-width: 0 !important;
	width: max-content !important;
}

.modalpopup[id$='-dropdown']:has(.ui-combobox-entry.ui-combobox-lineend) .ui-combobox-entry {
	width: 100%;
}

.modalpopup[id$='-dropdown']:has(.ui-combobox-entry.ui-combobox-lineend) .ui-combobox-search-container {
	display: none;
}

.modalpopup[id$='-dropdown'] .jsdialog.ui-separator.horizontal {
	margin: 4px 0;
	justify-self: stretch;
}

.ui-combobox-entry img:hover {
	border: 1px solid var(--color-border-darker);
	filter: contrast(0.5);
}

/* Orientation menu: split the highlight so the entry background stays on the
 * selected (first) entry, while the icon border indicates the current page
 * orientation */
.ui-combobox-entry.orientation-entry.checked::before {
	content: none;
}
.ui-combobox-entry.orientation-entry.notchecked::before {
	content: none;
}
.ui-combobox-entry.orientation-entry.checked img:not(:hover) {
	border: 1px solid var(--color-primary);
}
.ui-combobox-entry.orientation-entry.selected:not(:hover) span {
	background-color: var(--color-background-darker);
}

.ui-combobox-entry.selected:not(.checked):not(.notchecked) img:not(:hover) {
	border: 1px solid var(--color-primary);
}

/* Combobox entry with menu and thus arrow/chevron */
.ui-combobox-entry.ui-has-menu {
	display: grid;
	grid-template-columns: 1fr 25px;
	align-items: center;
}

/* add extra column space for the icon. */
.ui-combobox-entry.ui-has-menu.ui-has-img {
	grid-template-columns: 25px 1fr 25px;
}

/* In a menu whose entries carry a check mark, every entry starts with the place of the mark, so an
 * entry that opens a submenu has a column for it in front of the others. */
.ui-grid:has(.ui-combobox-entry.checked, .ui-combobox-entry.notchecked) .ui-combobox-entry.ui-has-menu {
	grid-template-columns: auto 1fr 25px;
}

.ui-grid:has(.ui-combobox-entry.checked, .ui-combobox-entry.notchecked) .ui-combobox-entry.ui-has-menu.ui-has-img {
	grid-template-columns: auto 25px 1fr 25px;
}

/* Arrow/chevron. Masked rather than drawn, so it takes the text colour: the
   asset's own #bbb is under 3:1 on white and vanishes on a focused entry. */
.ui-combobox-entry.ui-has-menu::after {
	content: '';
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-inline-start: -9px;
	background-color: currentColor;
	-webkit-mask: url('images/lc_menu_chevron.svg') no-repeat;
	mask: url('images/lc_menu_chevron.svg') no-repeat;
}

.ui-combobox-entry.ui-has-menu > span {
	/* menu entries have 5px all around padding,
	 add extra 9px at the horizontal end = 14px
	 so we can re-position the arrow/chevron  */
	padding-inline-end: 14px;
}

/* Apply style always show real colors */
#applystyle-dropdown .ui-dialog-content {
	background-color: white !important;
}

#applystyle-dropdown .ui-combobox-entry img {
	filter: none !important;
	max-height: 30px; /* hidpi, avoid blurry text */
}

/* ui-textarea */
.jsdialog.ui-textarea {
	color: var(--color-text-dark);
	background-color: var(--color-background-dark);
	border: 1px solid var(--color-border-dark);
	border-radius: var(--border-radius);
	vertical-align: top;
	width: -webkit-fill-available;
	width: -moz-available;
	width: stretch;
	/* keep the border/padding inside the width so a 100%-wide textarea lines up
	   with single-line entries instead of overflowing its grid cell */
	box-sizing: border-box;
}

/* buttons: btns.css */

/* Overflow group */

.ui-overflow-manager {
	display: flex !important;
}

.ui-overflow-group {
	flex-flow: column;
}

.ui-overflow-group,
.ui-overflow-group-content {
	display: flex;
}

.ui-overflow-group-bottom {
	text-align: center;
	align-items: center;
}

.notebookbar.ui-overflow-group-bottom {
	display: flex;
	padding: 0 5px;
	width: 100%;
	box-sizing: border-box;
}


.ui-overflow-group-label {
	font-family: var(--cool-font);
	font-size: var(--overflow-group-font-size);
	color: var(--color-text-light);
	flex-grow: 1;
	text-align: center;
}

#design-master-page-group-content.ui-overflow-group-inner {
	display: flex;
	justify-content: center;
	align-items: center;
}
/* Icon View */

.ui-iconview {
	overflow: auto;
	justify-content: space-between;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	max-height: calc(0.4 * var(--dialog-available-height));
	gap: var(--spacing-xs);
	padding: var(--spacing-xs);
	width: max-content;
}

.ui-iconview.mobile-wizard {
	justify-content: space-around;
}

/* Greyed out, non-interactive iconview */
.ui-iconview.disabled {
	opacity: 0.5;
	pointer-events: none;
}

@supports (display: flex) {
	.ui-iconview-entry {
		flex: 1;
	}
}

.ui-iconview-entry {
	float: left;
	text-align: center;
	position: relative;
	flex-direction: row;
	align-self: center;
	border: 1px solid transparent;
	border-radius: var(--border-radius);
	text-wrap: nowrap;
	font-family: var(--cool-font);
}

.ui-iconview-entry.selected {
	border: 1px solid var(--color-border-dark);
	border-radius: var(--border-radius);
	background-color: var(--color-background-dark);
}

.ui-iconview-entry:hover {
	border: 1px solid var(--color-border-darker);
	background-color: var(--color-background-darker);
}

.ui-iconview-entry img {
	vertical-align: middle;
	justify-self: center;
}

.ui-iconview-separator {
	flex: 0 0 99%;
}

.ui-iconview-entry-title {
	font-size: var(--default-font-size);
}

.icon-view-item-container {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Autofilter dropdown */

.autofilter-container {
	background-color: var(--color-main-background);
	border: 1px solid var(--color-border);
	position: absolute;
	z-index: 1105;
	padding: 0;
	font-family: var(--cool-font);
}

.autofilter-container > .root-container {
	margin: 0;
	padding: 0;
}

/* start: layouting has less cost when we have thousands of entries */
/* A row the search box filters out carries the hidden class. Leaving such a row
   out here lets its display: none win, as both declarations are important and
   the more specific selector would otherwise take it. */
.autofilter.ui-treeview-entry:not(.ui-treeview-tree):not(.hidden) {
	display: table-row !important;
}
.autofilter.ui-treeview-entry:not(.ui-treeview-tree) > div,
.autofilter.ui-treeview-entry:not(.ui-treeview-tree) > div:last-child {
	display: table-cell !important;
}
/* end: layouting optimization */

.autofilter-container .ui-treeview {
	border: none;
}

.autofilter-container #menu.ui-treeview {
	height: auto;
	width: 100%;
	padding: 8px 1px;
}

.autofilter-container #toggle_all.checkbutton {
	display: flex;
}

.autofilter-container #menu + #search_edit {
	display: block;
}

#mobile-wizard #toggle_all.checkbutton + #select_current,
.autofilter-container #select_current {
	background: url('images/lc_checkbox.svg') no-repeat center;
}

[data-theme='dark'] #mobile-wizard #toggle_all.checkbutton + #select_current,
.autofilter-container #select_current {
	background: url('images/dark/lc_checkbox.svg') no-repeat center;
}

.autofilter-container #select_current {
	/* Same size as #toggle_all.checkbutton > input */
	height: 18px;
	width: 18px;
	margin: var(--spacing-m);
	border: none;
}

#mobile-wizard #toggle_all.checkbutton + #select_current + #unselect_current,
.autofilter-container #unselect_current {
	background: url('images/lc_checkboxoff.svg') no-repeat center;
}

[data-theme='dark'] #mobile-wizard #toggle_all.checkbutton + #select_current + #unselect_current,
.autofilter-container #unselect_current {
	background: url('images/dark/lc_checkboxoff.svg') no-repeat center;
}

.autofilter-container #unselect_current {
	/* Same size as #toggle_all.checkbutton > input */
	height: 18px;
	width: 18px;
	margin: 8px 8px 8px 0px;
	border: none;
}

.autofilter-container #unselect_current img,
.autofilter-container #select_current img {
	display: none;
}

.autofilter-container #toggle_all.checkbutton > label,
.autofilter-container #toggle_all.checkbutton > input {
	height: 18px;
	line-height: normal;
}

.autofilter-container #check_tree_box.ui-treeview,
.autofilter-container #check_list_box.ui-treeview {
	width: 100%;
	min-width: 200px;
	max-height: 150px;
}

.autofilter-container-submenu > .autofilter-container {
	padding: 0px;
}

.autofilter-container-submenu .autofilter.root-container .ui-treeview {
	border-color: transparent;
}

/* Make the autofilter popup user-resizable. Selectors avoid :has() and deep
   descendants so styling cost stays off the list's many treeview entries. */
.autofilter-popup .jsdialog.lokdialog.ui-dialog-content {
	resize: both;
	overflow: auto;
	min-width: 220px;
	min-height: 200px;
	max-width: 498px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
}

/* Once the user drags the resize handle the browser writes an inline width on
   .ui-dialog-content; raise the cap so the popup can grow up to the viewport. */
.autofilter-popup .jsdialog.lokdialog.ui-dialog-content[style*='width'] {
	max-width: 95vw;
}

/* Ancestor chain of the check list, made into flex columns so the listbox
   fills the resized dialog. The GtkBox containers carry .autofilter-fill,
   tagged on the JSON at build time. The builder also inserts synthetic
   wrappers that have no JSON node (the top-level root-container/vertical and
   the scrollwindow's inner content div), so those are matched by class here.
   All of these are single elements, so styling cost stays off the list's
   many treeview entries. */
.autofilter-popup .root-container,
.autofilter-popup .vertical,
.autofilter-popup .ui-scrollwindow,
.autofilter-popup .ui-scrollwindow-content,
.autofilter-popup .autofilter-fill {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: none;
	/* Override inline height that the scrollwindow handler may have set. */
	height: auto !important;
}

/* Keep the 150px cap by default so the popup opens at its old compact size. */
.autofilter-popup #check_list_box.ui-treeview,
.autofilter-popup #check_tree_box.ui-treeview {
	flex: 1 1 auto;
	max-height: 150px;
	min-height: 0;
	/* Count the border and padding into the stretched width, so the list ends
	   at its container's edge and its vertical scrollbar stays fully visible. */
	box-sizing: border-box;
}

/* The menu above the check list has a fixed set of entries; the generic
 dialog treeview cap (150px) would clip the last one (Clear Filter). */
.autofilter-popup #menu.ui-treeview {
	max-height: none;
}

/* Drop the 1px/3px inline padding .ui-treeview gives itself, so a highlighted row spans the full width of its list. */
.autofilter-popup .ui-treeview,
.autofilter-submenu-popup .ui-treeview {
	padding-inline: 0;
}

/* A date tree entry is 100% of the list wide, so its borders have to count inside that or the row overflows by 2px. */
.autofilter-popup #check_tree_box.ui-treeview .ui-treeview-entry {
	box-sizing: border-box;
}

/* Once the user drags the resize handle the browser writes an inline height on
   .ui-dialog-content; drop the cap so the listbox fills the enlarged dialog. */
.autofilter-popup .jsdialog.lokdialog.ui-dialog-content[style*='height'] #check_list_box.ui-treeview,
.autofilter-popup .jsdialog.lokdialog.ui-dialog-content[style*='height'] #check_tree_box.ui-treeview {
	max-height: none !important;
}

/* hide the radio in filter by color, and the header cell over it */
.jsdialog.autofilter #background .ui-treeview-entry div:nth-of-type(1),
.jsdialog.autofilter #textcolor .ui-treeview-entry div:nth-of-type(1),
.jsdialog.autofilter #background .ui-treeview-headers > div:has(.ui-treeview-header-text:empty),
.jsdialog.autofilter #textcolor .ui-treeview-headers > div:has(.ui-treeview-header-text:empty) {
	display: none !important;
}

.jsdialog.autofilter #background .ui-treeview-header,
.jsdialog.autofilter #textcolor .ui-treeview-header {
	text-align: center;
}

.jsdialog.autofilter #background,
.jsdialog.autofilter #textcolor {
	padding-top: 0;
}

.jsdialog.autofilter #background .ui-treeview-headers,
.jsdialog.autofilter #textcolor .ui-treeview-headers {
	position: sticky;
	top: 0;
	background-color: var(--color-background-lighter);
	z-index: 1;
}

.jsdialog.autofilter #background .ui-treeview-entry > .ui-treeview-icon-column,
.jsdialog.autofilter #textcolor .ui-treeview-entry > .ui-treeview-icon-column {
	padding-inline: var(--spacing-m);
}

.jsdialog.autofilter #textcolor {
	margin-block-start: var(--spacing-m);
}

/* show the selection only in the focused list */
.jsdialog.autofilter #background:not(:focus-within) .ui-treeview-entry.selected,
.jsdialog.autofilter #textcolor:not(:focus-within) .ui-treeview-entry.selected {
	background-color: transparent;
	border-color: transparent;
	color: inherit;
}

/* border-less arrow icons in the autofilter menu */
#menu img.jsdialog.autofilter.ui-treeview-checkbox.ui-treeview-image {
	display: inline;
	outline: none;
}

/* Word count dialog */

#WordCountDialog #label10,
#WordCountDialog #documentlabel-mobile {
	color: #636363 !important;
}

#documentlabel-mobile {
	padding-top: 10px;
}

/* Labels are inline elements, so the headers float to make clear take effect. */
#mobile-wizard #WordCountDialog #label9,
#mobile-wizard #WordCountDialog #documentlabel-mobile {
	float: left !important;
	clear: both !important;
}

#mobile-wizard #wordslabel,
#mobile-wizard #inclspaceslabel,
#mobile-wizard #exclspaceslabel,
#mobile-wizard #cjkcharsft,
#mobile-wizard #wordslabel2,
#mobile-wizard #inclspaceslabel2,
#mobile-wizard #exclspaceslabel2,
#mobile-wizard #cjkcharsft2,
#mobile-wizard #commentslabel {
	float: left !important;
	clear: left !important;
	margin: 0 0 0 4%;
	width: 72% !important;
	color: #636363 !important;
}

#mobile-wizard #selectwords,
#mobile-wizard #selectchars,
#mobile-wizard #selectcharsnospaces,
#mobile-wizard #selectcjkchars,
#mobile-wizard #docwords,
#mobile-wizard #docchars,
#mobile-wizard #doccharsnospaces,
#mobile-wizard #doccjkchars,
#mobile-wizard #docComments {
	float: right !important;
	clear: right !important;
	margin: 0 4% 0 0;
	width: 20% !important;
	border-bottom: none !important;
	color: #636363 !important;
}

/* Dialog-specific exceptions */
#DefineNameDialog .cell.jsdialog,
#ManageNamesDialog .cell.jsdialog {
	padding-left: 0px;
}

#table-Selection .jsdialog.ui-listbox {
	margin: 8px 2px 2px;
}

#SelectSourceDialog .ui-frame-label {
	display: none;
}

#hideitems {
	border: none;
}

/* Fontwork dialog */

#FontworkGalleryDialog #ctlFavoriteswin {
	width: 400px;
	height: 400px;
}
#FontworkGalleryDialog #label1 {
	display: none;
}

/* In the FormatCellsDialog. */
#CellProtectionPage #label1 {
	max-width: 52ch; /* wraps the long note instead of widening the page */
}

/* Macros dialog */

#MacroWarnMedium label {
	max-width: 400px;
	color: var(--color-main-text);
	text-transform: none;
}

#MacroSelectorDialog #helpmacro {
	margin-bottom: 8px;
	text-transform: none;
	font-size: var(--default-font-size);
}

#MacroSelectorDialog #description {
	text-transform: none;
}

#MacroSelectorDialog #commands,
#MacroSelectorDialog #categories {
	height: 150px;
}

#MacroSelectorDialog #categories {
	box-sizing: border-box;
	border-color: transparent;
}

#MacroSelectorDialog #categories .ui-treeview-entry div.selected, #MacroSelectorDialog #categories .ui-treeview-entry, #MacroSelectorDialog #categories .ui-treeview-entry.selected {
	background-color: var(--color-background-dark);
	color: var(--color-text-dark);
}
#MacroSelectorDialog #categories .ui-treeview-entry div:hover, #MacroSelectorDialog #categories .ui-treeview-entry div.selected:hover, #MacroSelectorDialog #categories .ui-treeview-entry:hover, #MacroSelectorDialog #categories .ui-treeview-entry.selected:hover, #MacroSelectorDialog #categories .ui-treeview-entry div.selected {
	background-color: var(--color-background-darker);
	color: var(--color-text-darker);
}

/* color selector */
.has-colorpicker.unotoolbutton > .unobutton img {
	height: var(--btn-img-colorpicker-size);
}
.unotoolbutton .selected-color {
	box-sizing: border-box;
	height: var(--btn-color-colorpicker-size);
	width: calc(var(--btn-img-size) - var(--btn-padding) * 2);
	position: relative;
	border: 1px solid var(--color-border-dark);
	border-radius: 7px;
	outline: 1px solid var(--color-background-lighter);
}
#context-toolbar .unotoolbutton .selected-color {
	outline: 1px solid var(--color-border-dark-63);
}

/* dropdown arrow */
.unoarrow, .menubutton .arrow {
	width: auto !important;
	height: 0px;
	font-size: 0;
	line-height: 0;
	border: 4px solid transparent;
	border-top: 5px solid var(--color-main-text);
	display: inline-block !important;
	margin-inline-start: 3px;
	margin-top: 4px;
}

.unoarrow:not([disabled]):hover, .menubutton .arrow:not([disabled]):hover {
	border-top: 5px solid var(--color-text-darker);
}

.arrowbackground {
	box-sizing: border-box;
	width: var(--btn-arrow-size);
	height: 100%;
	display: flex;
	align-items: center;
	border-left: 1px solid transparent;
	background-color: transparent;
	grid-column: 3;
	position: relative;
	border: none;
	padding: 1px;
}

.arrowbackground:hover {
	border-left-color: transparent;
	background-color: var(--color-background-darker);
}

.menubutton:not(.splitbutton) .arrowbackground,
.menubutton:not(.splitbutton) .arrowbackground:hover {
	border-left-color: transparent;
	background-color: transparent;
}

.unoarrow:not([disabled]):hover, .arrowbackground:not([disabled]):hover .unoarrow {
	border-top-color: var(--color-text-darker);
}

/* menu button */
.jsdialog.menubutton {
	box-sizing: border-box;
	line-height: normal;
	font-size: calc(var(--default-font-size)*1.2);
	font-family: var(--cool-font);
	border: 1px solid var(--color-border-dark);
	border-radius: var(--border-radius);
	padding: 8px 10px;
	margin: 2px 0px;
	background-color: var(--color-background-dark);
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The whole box opens the menu, border and padding included, so it shows the hand cursor. A
 * split button has its two targets inside, and they carry the cursor themselves. */
.jsdialog.menubutton:not(.splitbutton):not([disabled]) {
	cursor: pointer;
}

/* A menu button that asks for its content at one end shows it there, the way a
 * list box shows its text. The arrow stays at the far end of the button. */
.jsdialog.menubutton.content-start {
	justify-content: flex-start;
}

.jsdialog.menubutton.content-start .arrow {
	margin-inline-start: auto;
}

.jsdialog.menubutton.content-end {
	justify-content: flex-end;
}

/* The generic secondary button rule in btns.css hands every button a 5px side
 * margin and a width that follows its content. In a grid that pushes a menu
 * button out of its column, so it no longer lines up with the list boxes and
 * spin fields in the rows around it. A cell takes its width from the column,
 * so both are undone here. The rule in btns.css names a long list of classes
 * at once, so these need !important to win against it. A hidden menu button
 * keeps the zero width that every hidden grid child has. */
.ui-grid > button.jsdialog.menubutton:not(.hidden) {
	margin-inline: 0 !important;
	width: auto !important;
}

.jsdialog.menubutton img {
	margin-inline-end: 4px;
}

[data-userinterfacemode='classic'] #toolbar-wrapper .jsdialog.menubutton img {
	margin-inline-end: 0;
}

button.menubutton.sidebar > span {
	box-shadow: none !important;
	font-size: var(--default-font-size) !important;
}

.jsdialog .unobutton img {
	width: var(--btn-img-size);
	height: var(--btn-img-size);
}

button.has-img img {
	min-width: 16px;
	min-height: 16px;
}

.menubutton .arrow {
	display: table-cell !important;
	float: right;
	margin: 5px 0 0 5px;
}

.jsdialog.menubutton[disabled] {
	background-color: transparent !important;
	color: var(--color-text-light) !important;
}

.jsdialog.menubutton[disabled] .arrow {
	border-top-color: var(--color-text-light);
}

/* toolbox */
.jsdialog.toolbox {
	display: flex;
}

/* sub-toolbar in a popup, e.g. Fontwork Shape: rows instead of one long line */
.modalpopup .jsdialog.toolbox#managedtoolbar {
	display: grid;
	grid-template-columns: repeat(6, auto);
}

.jsdialog.ui-spacer {
	display: flex;
	flex-grow: 1;
}

/* spinner */
.spinner {
	border: 6px solid #f3f3f3; /* Light grey */
	border-top: 6px solid grey; /* Blue */
	border-radius: 50%;
	width: 30px;
	height: 30px;
	animation: spin 2s linear infinite;
}

/* color picker */
.ui-color-picker {
	padding: var(--spacing-s);
}

.ui-color-picker-header {
	display: grid;
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: var(--spacing-m);
}

.ui-color-picker,
#ui-color-picker-custom,
#ui-color-picker-recent {
	display: grid;
	grid-gap: var(--spacing-s);
	align-items: center;
}

.ui-color-picker-palette {
	display: grid;
	grid-gap: var(--spacing-s);
	margin-top: 3px;
}

.ui-color-picker-entry {
	border: 1px solid transparent;
	cursor: pointer;
	width: 24px;
	height: 24px;
	appearance: none;
	webkit-appearance: none;
	margin: 0;
}

.ui-color-picker-entry:checked {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 3px rgba(255, 255, 255, 0.8);
}

.ui-color-picker-entry:hover,
.ui-color-picker-entry:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 1px;
}

#ui-color-picker-custom,
#ui-color-picker-recent {
	grid-auto-flow: column;
}

.ui-color-picker .ui-listbox-container,
.ui-color-picker button {
	margin: 0px !important;
	width: 100% !important;
}

#ui-color-picker-custom input {
	max-width: 75px;
}

/* emoji picker */
.ui-emoji-picker {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-m);
	padding: var(--spacing-s);
	box-sizing: border-box;
}

.ui-emoji-picker-search {
	width: 100%;
	box-sizing: border-box;
	padding: 6px 10px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	font-size: 12px;
	font-family: var(--cool-font);
	color: var(--color-main-text);
	background: var(--color-main-background);
}

.ui-emoji-picker-search:focus {
	border-color: var(--color-primary);
	outline: none;
}

.ui-emoji-picker-grid {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ui-emoji-picker-heading {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--color-text-lighter);
	margin-top: 4px;
}

.ui-emoji-picker-row {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
}

.ui-emoji-picker-cell {
	width: 28px;
	height: 28px;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	border: 0;
	background: transparent;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ui-emoji-picker-cell:hover,
.ui-emoji-picker-cell:focus-visible {
	background: rgba(var(--color-primary-rgb, 11, 135, 231), 0.1);
	outline: none;
}

/* chip widget - see Widget.Chip.ts for the JSON contract.
   The outer .ui-chip carries the pill: a single rounded border and
   background that the inner buttons inherit. The inner buttons
   (.ui-chip-main and .ui-chip-action) are excluded from the
   project-wide button catch-alls in btns.css and device-desktop.css
   so they can stay transparent and the pill paints continuously. */
.ui-chip {
	display: inline-flex;
	align-items: stretch;
	gap: 0;
	box-sizing: border-box;
	max-width: 100%;
	background: var(--color-main-background);
	border: 1px solid var(--color-border);
	border-radius: 999px;
	overflow: hidden;
	transition: background var(--duration-fast) var(--ease-standard),
		border-color var(--duration-fast) var(--ease-standard);
}

.ui-chip:hover {
	border-color: rgba(var(--color-primary-rgb, 11, 135, 231), 0.4);
}

.ui-chip:has(.ui-chip-main[aria-pressed='true']) {
	background: var(--color-main-text);
	border-color: var(--color-main-text);
}

.ui-chip-main,
.ui-chip-action {
	background: transparent;
	border: 0;
	border-radius: 0;
	margin: 0;
	color: var(--color-main-text);
	font-family: var(--cool-font);
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color var(--duration-fast) var(--ease-standard),
		background var(--duration-fast) var(--ease-standard);
}

.ui-chip-main {
	flex: 1 1 auto;
	min-width: 0;
	gap: 6px;
	padding: 7px 4px 7px 12px;
	height: 34px;
	white-space: nowrap;
}

.ui-chip:has(.ui-chip-action) .ui-chip-main {
	padding-right: 4px;
}

.ui-chip:not(:has(.ui-chip-action)) .ui-chip-main {
	padding-right: 12px;
}

.ui-chip-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
}

.ui-chip-icon img {
	width: 14px;
	height: 14px;
}

.ui-chip-text {
	overflow: hidden;
	text-overflow: ellipsis;
}

/* The inner spans must follow the button's color so the pressed-state
   colour flip below reaches the visible text. The `.sidebar *` rule
   in jssidebar.css would otherwise pin every descendant to
   var(--color-main-text), which makes the label invisible against
   the dark pressed pill. Two-class selectors here beat .sidebar *. */
.ui-chip .ui-chip-text,
.ui-chip .ui-chip-icon {
	color: inherit;
}

.ui-chip-action {
	flex: 0 0 auto;
	padding: 0 10px 0 2px;
	height: 34px;
	min-width: 0;
	color: var(--color-text-lighter);
}

.ui-chip-action img {
	width: 14px;
	height: 14px;
	opacity: 0.7;
}

.ui-chip-action:hover {
	color: var(--color-main-text);
}

.ui-chip-action:hover img {
	opacity: 1;
}

.ui-chip:has(.ui-chip-main[aria-pressed='true']) .ui-chip-main,
.ui-chip:has(.ui-chip-main[aria-pressed='true']) .ui-chip-action {
	color: var(--color-main-background);
}

.ui-chip:has(.ui-chip-main[aria-pressed='true']) .ui-chip-action {
	color: rgba(255, 255, 255, 0.7);
}

.ui-chip:has(.ui-chip-main[aria-pressed='true']) .ui-chip-action:hover {
	color: #fff;
}

.ui-chip-main:focus-visible,
.ui-chip-action:focus-visible {
	outline: 2px solid rgb(var(--color-primary-rgb, 11, 135, 231));
	outline-offset: -2px;
}

.ui-chip[disabled],
.ui-chip-main[disabled],
.ui-chip-action[disabled] {
	cursor: default;
	opacity: 0.5;
}

/* progressdots: one dot per step, and the dot of the current step stretches
   into a pill in the colour of the document type. The colours are declared on
   the widget root, because --doc-type is declared on the body and a var() in a
   custom property is resolved where that property is declared. */
.ui-progressdots {
	--progressdots-current: rgb(var(--doc-type, 3, 105, 163));
	--progressdots-idle: var(--color-text-light);
	display: flex;
	align-items: center;
	gap: var(--spacing-s);
}

/* The dark theme reads --color-text-light as white, which would make the idle
   dots brighter than the current one. */
[data-theme='dark'] .ui-progressdots {
	--progressdots-idle: var(--color-border-darker);
}

.ui-progressdots-dot {
	width: 6px;
	height: 6px;
	border-radius: var(--border-radius-pill);
	background-color: var(--progressdots-idle);
}

.ui-progressdots-dot.ui-progressdots-current {
	width: 16px;
	background-color: var(--progressdots-current);
	animation: ui-progressdots-grow 0.2s ease-out;
}

/* The dots are built again for every change, so the current dot grows from
   the size of the others when it is shown. */
@keyframes ui-progressdots-grow {
	from {
		width: 6px;
	}

	to {
		width: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ui-progressdots-dot.ui-progressdots-current {
		animation: none;
	}
}

/* busy popup */

#busypopup.jsdialog-container {
	min-width: 200px;
	min-height: 100px;
	background: var(--color-background-lighter);
}

#busypopup .lokdialog {
	z-index: 1;
}

#busypopup .vertical {
	margin: auto;
}

#busypopup #busyspinner {
	margin: -20px auto 0px;
}

#busypopup #busyspinner svg {
	display: block;
	margin: auto;
}

#busypopup #busylabel,
.popup  #busylabel {
	margin: 20px;
	text-align: center;
	font-size: 100%;
	text-transform: initial;
	display: block;
}

#busypopup #spinner-paper-g,
.popup #spinner-paper-g {
	animation-iteration-count: infinite;
	animation-direction: normal; /* Safari 4.0 - 8.0 */
	animation-play-state: running;
	animation-name: spinner-saving-anim;
	animation-duration: 2s;
	animation-timing-function: ease-in-out;
}
@keyframes spinner-saving-anim {
	0% {transform: translateY(-20px) translateX(0px); opacity: 0;}
	20% {transform: translateY(5px) translateX(15px); opacity: 1;}
	45% {transform: translateY(22px) translateX(-10px); opacity: 1;}
	100% {transform: translateY(60px) translateX(15px); opacity: 0;}
}

/* The sheet of paper travels 80 pixels down the dialog and swings sideways on the way. Under
   reduced motion it stays in place and fades in and out instead, which still tells the user that
   the save is running. */
@media (prefers-reduced-motion: reduce) {
	#busypopup #spinner-paper-g,
	.popup #spinner-paper-g {
		animation-name: spinner-saving-pulse;
	}
}

@keyframes spinner-saving-pulse {
	0%, 100% {opacity: 0.2;}
	50% {opacity: 1;}
}

.spinner-img #spinner-box-f-right {
	fill: rgba(var(--doc-type),0.5);
}
.spinner-img #spinner-box-f-left {
	fill: rgba(var(--doc-type),0.2);
}
.spinner-img #spinner-inner-right {
	fill: rgba(var(--doc-type),0.5);
}
.spinner-img #spinner-box-back {
	fill: rgba(var(--doc-type),0.4);
}
.spinner-img #spinner-handle {
	stroke: rgba(var(--doc-type),0.8);
}
.spinner-img #spinner-inner-left-linearGradient stop:first-child {
	stop-color: rgba(var(--doc-type));
	stop-opacity: 0.7;
}
.spinner-img #spinner-inner-left-linearGradient stop:nth-child(2) {
	stop-color: rgba(var(--doc-type));
	stop-opacity: 0.5;
}
.spinner-img #spinner-paper-fold {
	fill: rgba(var(--doc-type),0.8);
}
.spinner-img #spinner-paper-linearGradient stop:first-child {
	stop-color: rgba(var(--doc-type));
	stop-opacity: 0.3;
}
.spinner-img #spinner-paper-linearGradient stop:nth-child(2) {
	stop-color: rgba(var(--doc-type));
	stop-opacity: 0.2;
}

/* Progress bar - progressbar.css */

/* snackbar */
.snackbar {
	border: none !important;
}
.snackbar.jsdialog-window {
	overflow: visible;
}
.jsdialog-window.snackbar.fadein {
	animation: slide-up-in var(--duration-normal) var(--ease-out);
}
.snackbar-leaving {
	pointer-events: none;
	animation: fade-out var(--duration-fast) var(--ease-in) forwards;
}
.snackbar #snackbar-container,
.snackbar #snackbar-container-progress {
	align-items: center;
	max-width: calc(80vw);
	row-gap: var(--spacing-s);
}

.snackbar .ui-progressbar progress {
	min-width: 120px;
	margin-right: 10px;
}

.snackbar .ui-progressbar progress::-webkit-progress-bar {
	background-color: #FFFF;
}

#mobile-wizard.popup.snackbar,
.snackbar.jsdialog-container .ui-dialog-content {
	min-width: 200px;
	background-color: #323232 !important;
}
.snackbar.jsdialog-container .ui-dialog-content {
	width: max-content !important;
}
#mobile-wizard.popup.snackbar #label,
.snackbar.jsdialog-container #label,
#mobile-wizard.popup.snackbar #label-no-action,
.snackbar.jsdialog-container #label-no-action {
	color: white !important;
	font-size: var(--header-font-size) !important;
	margin: 0px !important;
	border-bottom: none !important;
	padding-left: 12px;
	flex: min-content;
	text-transform: inherit;
}

#mobile-wizard.popup.snackbar #label-no-action,
.snackbar.jsdialog-container #label-no-action {
	padding-right: 8px;
	text-align: center;
}

.snackbar.jsdialog-container #label {
	padding: 2px 24px 2px 8px;
}

.snackbar.jsdialog-container #label-no-action {
	padding: 2px 8px;
}

#mobile-wizard.popup.snackbar [id$='button'],
.snackbar.jsdialog-container [id$='button'].ui-pushbutton.jsdialog {
	padding-right: 12px;
	background-color: transparent !important;
	border: none !important;
	margin: 0 !important;
	justify-content: center;
	cursor: pointer;
}

.snackbar.jsdialog-container [id$='button'].ui-pushbutton.jsdialog {
	padding: var(--spacing-m);
}

#snackbar-container-progress .ui-progressbar {
	display: grid;
	grid-column: 1 / 3;
}

#snackbar-container-progress {
	grid-template-rows: repeat(2, auto);
	grid-template-columns: repeat(2, auto);
}

#mobile-wizard.popup.snackbar [id$='button'] {
	padding: var(--spacing-m);
}

#mobile-wizard.popup.snackbar [id$='button'],
.snackbar.jsdialog-container [id$='button'] {
	color: var(--color-primary-lighter) !important;
	font-weight: 600;
	font-size: var(--header-font-size) !important;
	display: flex;
	align-items: center;
}
.snackbar.jsdialog-container [id$='button'].ui-pushbutton.jsdialog:hover {
	background-color: #ffffff15 !important;
}

.snackbar.jsdialog-container #snackbar-dismiss-button .ui-pushbutton.has-img {
	border-radius: 50% !important;
	min-width: var(--btn-size);
	min-height: var(--btn-size);
}

.snackbar.jsdialog-container #snackbar-dismiss-button .ui-pushbutton.has-img img {
	width: 16px;
	height: 16px;
	filter: brightness(0) invert(1);
}

/* toolbuttons */
.jsdialog .ui-content.unobutton {
	height: var(--btn-size);
	width: var(--btn-size);
	display: flex;
	flex-direction: column;
	padding: var(--btn-padding);
	vertical-align: middle;
	background-color: transparent;
	border: none;
	position: relative;
	overflow: hidden;
	justify-content: center;
	align-items: center;
}

#toolbar-wrapper:not(.mobile) ~ #toolbar-down .has-dropdown > .ui-content.unobutton {
	width: max-content;
}

.jsdialog .ui-content.unobutton::after {
	--click-increment: -1px;
	position: absolute;
	content: '';
	top: var(--click-increment);
	right: var(--click-increment);
	bottom: var(--click-increment);
	left: var(--click-increment);
	pointer-events: none;
}

/* targetting buttons inside of split button */
.notebookbar .splitbutton > .ui-content.unobutton:hover,
.jsdialog .splitbutton > .ui-content.unobutton:hover {
	background-color: var(--color-background-darker);
}

.unotoolbutton.has-dropdown {
	display: grid;
	align-items: center;
	grid-auto-flow: column;
	grid-template-rows: auto 0px;
}

/* handling show/hide state */
.hidden {
	display: none !important;
}

/* dialog/popup fade animation */
.fadein {
	animation: fade-in var(--duration-fast) var(--ease-out);
}
.fsdialog-overlay {
	animation: fade-in var(--duration-slow) var(--ease-out);
}
.fadeout {
	animation: fade-out var(--duration-fast) var(--ease-in) forwards;
}

.jsdialog-window.dropdown-fade-scale {
	animation: fade-scale-in var(--duration-fast) var(--ease-out);
}

/* images */

.ui-image {
	margin: auto;
}

.ui-drawing-area-container {
	margin: auto;
}

.ui-drawing-area:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
	border-radius: var(--border-radius);
}

/* Writer - Insert - Page Number - page preview image */
[data-theme='dark'] #PageNumberDialog #previewImage {
	filter: invert(.95)
}

/* Writer - Table of Contents, Index or Bibliography dialog, Columns tab */
[data-theme='dark'] #ColumnPage #pageexample-img,
[data-theme='dark'] #ColumnPage #column-iconview img {
	filter: invert(.9)
}

/* Position and Size dialog - drawing area images */
[data-theme='dark'] #CTL_POSRECT img.ui-drawing-area,
[data-theme='dark'] #CTL_SIZERECT img.ui-drawing-area,
[data-theme='dark'] #CTL_RECT img.ui-drawing-area,
[data-theme='dark'] #CTL_ANGLE img.ui-drawing-area,
[data-theme='dark'] #daRatioTop img.ui-drawing-area,
[data-theme='dark'] #daRatioBottom img.ui-drawing-area,
[data-theme='dark'] img#imRatio.ui-image {
	filter: invert(.95)
}

/* scrollable content */
.ui-scrollable-content {
	overflow-x: scroll;
	overflow-y: hidden;
	scrollbar-width: none; /* Firefox >= 64 */
	display: flex;
	align-items: center;
}

.ui-scrollable-content::-webkit-scrollbar { /* WebKit */
	width: 0;
	height: 0;
}

/* formulabar */
#sc_input_window.formulabar {
	border: 1px solid var(--color-border-input);
	flex-grow: 1;
	background-color: var(--color-background-lighter);
	border-radius: var(--border-radius) 0 0 var(--border-radius);
	align-self: stretch;
}

.ui-custom-textarea {
	position: relative;
}

.ui-custom-textarea-overflow-wrapper {
	overflow: auto;
	overscroll-behavior: none;
	width: 100%;
	height: 100%;
	display: grid;
}

.ui-custom-textarea.focused {
	border: 1px solid var(--color-primary) !important;
	/* currentColor is the only ring a brand cannot drop below 3:1: the text
	   it takes is already held to 4.5:1 against this background. */
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.ui-custom-textarea,
.ui-custom-textarea-cursor-layer,
.ui-custom-textarea-handle-layer,
.ui-custom-textarea-text-layer {
	font-family: monospace;
	line-height: 1.2;
	font-size: calc(var(--default-font-size)*1.2) !important;
	color: var(--color-main-text);
	overflow-wrap: anywhere;
}

.ui-custom-textarea-cursor-layer,
.ui-custom-textarea-handle-layer,
.ui-custom-textarea-text-layer {
	padding: var(--spacing-s);
	grid-column: 1;
	grid-row: 1;
	white-space: pre-wrap;
}

.ui-custom-textarea-cursor-layer {
	color: transparent;
	pointer-events: none;
}

.ui-custom-textarea-handle-layer {
	position: absolute; /* both lets us position handles absolute to this and pulls us out of the overflow: auto */
}

.ui-custom-textarea.focused .ui-custom-textarea-cursor-layer span.cursor:not(.hidden) {
	border-left: 1px solid var(--color-cursor-blink-background);
	margin-left: -1px;
}

.ui-custom-textarea-cursor-layer span.selection:not(.hidden) {
	background-color: var(--color-primary-darker);
	color: var(--color-primary-text);
}

#sc_input_window.formulabar.expanded {
	border-radius: var(--border-radius) 0 var(--border-radius) var(--border-radius) !important;
}

#formulabar-buttons-toolbox.formulabar.toolbox {
	display: grid;
	grid-auto-flow: column;
	align-items: center;
	grid-column-gap: var(--spacing-s);
	grid-template-columns: repeat(3, 30px);
}

#formulabar-buttons-toolbox * {
	align-items: center;
	justify-content: center;
}

.unotoolbutton.formulabar {
	display: flex;
}

.formulabar.unotoolbutton {
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0.8;
}

.formulabar.unotoolbutton:hover {
	opacity: 1;
}

.formulabar.unotoolbutton img, .formulabar.ui-pushbutton {
	height: 24px !important;
	width: 24px !important;
	min-width: unset !important;
}

#expand.formulabar {
	height: 30px !important;
	margin: 0 !important;
	border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
	border-inline-start: none !important;
	background-color: var(--color-main-background) !important;
}

/* Zotero dialog*/

#ZoteroDialog .ui-treeview {
	max-height: 500px;
	max-width: 100%;
}

#ZoteroDialog-mainbox.jsdialog .ui-treeview {
	height: 400px;
}

#ZoteroDialog-search-container.jsdialog, #ZoteroDialog-locale-container.jsdialog {
	margin-block: 7px;
}

#ZoteroDialog-search-container.jsdialog {
	/* Refresh button (shorter) and Search input (32px tall) sit side by side
	   - vertically center them instead of top-aligning. */
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

#ZoteroDialog-locale-container.jsdialog {
	width: fit-content;
}

#zoterocategory.jsdialog {
	margin-inline-end: 7px;
	min-width: 150px !important;
	overflow-x: scroll;
}

#zoterolist.jsdialog {
	width: min(800px, calc(0.8 * var(--dialog-available-width)));
}

.jsdialog[id^='zotero'][id$='-label'] {
	margin-inline-end: 7px;
}

.jsdialog[id^='zotero'][id$='-label']:not(:first-child) {
	margin-inline-start: 24px;
}

/* hover effect */
.jsdialog.menubutton:not([disabled]):hover,
.ui-listbox:not([disabled]):hover,
.jsdialog.ui-edit:not([disabled]):hover,
.jsdialog.ui-textarea:not([disabled]):hover {
	color: var(--color-text-darker);
	background-color: var(--color-background-lighter);
	border: 1px solid var(--color-border-darker);
}
#toolbar-down .unobutton .unolabel {
	cursor: pointer;
}
/* Gated to real pointers - on touch, :hover sticks after a tap and the
   transparent !important below would mask .selected until the next tap. */
@media (hover: hover) {
	#toolbar-down .jsdialog.menubutton:not([disabled]):hover,
	#toolbar-down .ui-listbox:not([disabled]):hover,
	#toolbar-down .jsdialog.ui-edit:not([disabled]):hover,
	#toolbar-down .jsdialog.ui-textarea:not([disabled]):hover {
		color: var(--color-text-darker);
		background-color: transparent !important;
		border-color: transparent;
	}
	#toolbar-down .unotoolbutton:hover {
		background-color: transparent !important;
		border-color: transparent;
	}
}

#toolbar-down  .jsdialog .ui-edit-container {
	place-content: center;
}

/* Formula Wizard */
#FormulaDialog .ui-tabs-root {
	background-color: var(--color-background-tabs-group);
	border-radius: var(--border-radius-large);
}
#FormulaDialog .jsdialog.ui-tabpage {
	display: flex;
}
#FormulaDialog .jsdialog.ui-tabpage > .ui-grid {
	grid-template-rows: 0 auto !important;
	grid-gap: 0px;
}
#FormulaDialog #StructPage {
	display: grid;
	grid-template-rows: auto 1fr;
	grid-row-gap: var(--spacing-s);
}
#FormulaDialog #StructPage .ui-treeview-entry div {
	background-color: transparent;
}
#FormulaDialog #search {
	display: flex;
}
#FormulaDialog #search-input {
	flex-grow: 1;
}
#FormulaDialog #ParameterPage > .ui-grid-cell {
	display: flex;
	flex-direction: column;
}

#FormulaDialog > [id^='dialog-vbox'] > [id^='box'] > [id^='box'] {
	grid-auto-columns: max-content;
	grid-column-gap: var(--spacing-m);
}

#FormulaDialog label {
	max-width: 400px;
}
#FormulaDialog #box3 {
	display: grid;
	min-width: 400px;
	grid-template-rows: auto 1fr auto auto;
}

#FormulaDialog #box3:has(#favorites:not(.hidden)) #ParameterPage {
	display: none !important;
}

#FormulaDialog .ui-tabs-content.jsdialog {
	grid-auto-columns: 250px;
	margin-top: 0px;
}

#FormulaDialog #box3 :is(#grid2, #grid3) {
	align-items: center;
}

#FormulaDialog #ALTBOX #headline {
	font-weight: bold;
}

#FormulaDialog #ALTBOX {
	align-content: start;
}

#FormulaDialog #ALTBOX > .ui-grid-cell:first-child {
	display: flex !important;
	justify-content: flex-start;
	align-items: center;
	gap: var(--spacing-xs);
}

#FormulaDialog #favorites,
#FormulaDialog #favorites-button {
	border: none !important;
	background: transparent !important;
	margin: 0 !important;
	height: auto !important;
	min-width: 0 !important;
	width: auto !important;
	padding: 2px;
}

#FormulaDialog #FunctionPage #help {
	width: 100%;
	justify-content: stretch;
}
#FormulaDialog #FunctionPage #help-button {
	width: 100% !important;
}

/* text-area overflow on function wizard window */

#FormulaDialog #ed_formula.ui-textarea {
	max-width: 392px;
}

#FormulaDialog #tabcontrol {
	margin-inline-end: 10px;
}

#FormulaDialog .ui-tabpage > div > .ui-grid-cell > :not(.ui-pushbutton-wrapper) {
	margin: auto 4px;
}

#FormulaDialog .ui-pushbutton-wrapper {
	background: initial;
}

#FormulaDialog {
	/* don't leave white area below the functions if right panel is short */
	height: 100%;
}

#FormulaDialog .ui-textarea {
	margin-top: 10px;
}

/* Paste Special: equal-width, left-aligned preset buttons */
#PasteSpecial #frmPresets .ui-pushbutton-wrapper > .ui-pushbutton {
	flex: 1 1 auto;
	gap: 6px;
	white-space: nowrap;
	justify-content: flex-start;
	padding-inline-start: 7px;
}

div [id^='TemplateDialog'] {
	min-width: 590px;
}

#CharacterPropertiesDialog {
	min-width: 656px;
}

/* Keyboard input keys */
kbd,
.kbd {
	background-color: var(--color-background-dark);
	border-radius: var(--border-radius);
	border: 1px solid var(--color-border-dark);
	color: var(--color-text-dark);
	display: inline-block;
	font-family: monospace;
	font-size: .85em;
	line-height: 1;
	padding: var(--spacing-s);
	white-space: nowrap;
}

.kbd--plus {
	color: var(--color-text-dark);
	padding: 0 4px;
	font-size: 0.85em;
}

.warn-copy-paste {
	width: 100%;
}

/* Insert hyperlink dialog */

#HyperlinkDocPage,
#HyperlinkInternetPage,
#HyperlinkMailPage {
	width: 100%;
}

#HyperlinkInternetPage #grid2,
#HyperlinkInternetPage #label2,
#HyperlinkInternetPage #lbProtocol,
#HyperlinkInternetPage #linktyp_ftp,
#HyperlinkInternetPage #linktyp_internet {
	display: none;
}

#HyperlinkInternetPage #grid1,
#HyperlinkInternetPage #grid3,
#HyperlinkMailPage #grid3 {
	grid-template-columns: 1fr 3fr !important;
	column-gap: 0px !important;
}

/* Third column has nothing to display */
#HyperlinkMailPage #grid1 {
	grid-template-columns: 1fr 3fr 0px !important;
	column-gap: 0px !important;
}

/* Unlike frame1, and both frames on the mail page, this only has one element,
   and is therefore a div not a fieldset. Fieldsets have 2px margin on both sides,
   so add it here to to align elements. */
#HyperlinkInternetPage #frame2 {
	margin-left: 2px;
	margin-right: 2px;
}

/* The Target frame renders as a div, the Text and Name frame below as a
   fieldset with a 2px side margin. Add the same margin so they line up. */
#HyperlinkDocPage #frame3 {
	margin-left: 2px;
	margin-right: 2px;
}

#HyperlinkDocPage #grid5 {
	/* Match the label column width and zero gap of the Text and Name grid so
	   the Target field starts at the same left edge. The last 38px column is
	   for the browse button. */
	grid-template-columns: 90px 1fr 38px !important;
	column-gap: 0px !important;
}

#HyperlinkDocPage #frame1,
[id^='Hyperlink'] .ui-grid-cell:empty,
[id^='Hyperlink'] .hidden {
	display: none;
}

/* grid requires all elements to occupy space, but we can reduce their sizing.
   Right-align the button in its column so its right edge lines up with the
   Text and Name fields, keeping it centred vertically. */
[id^='Hyperlink'] #browse button {
	margin: auto 0 auto auto;
	max-height: 32px;
}

/* feature_lock */
#modal-dialog-unlock-features-popup {
	width: 652px;
	min-width: auto;
	max-width: none;
}
#unlock-features-popup .container {
	display: flex;
	flex-direction: row;
}
#unlock-features-popup #unlock-image {
	flex: 1.3;
	background: transparent no-repeat left 4px /contain;
	background-image: none;
	height: 288px;
	margin-inline-end: 0.5em;
}
#unlock-features-popup .item {
	flex: 1;
}
#unlock-features-popup .item *:not(ul, li) {
	margin-inline-start: 1.1em;
}
#unlock-features-popup .item ul {
	list-style: none;
	padding: 0;
	font-size: 0.84em;
	text-shadow: 1px 1px 12px #ffbf0038, 0 0 0.5px #00000026;
}
#unlock-features-popup h1 {
	margin-bottom: .5em;
	font-size: 1.1em;
	color: #fda208;
}
#unlock-features-popup ul {
	list-style: none;
	padding: 0;
	font-size: 0.84em;
	text-shadow: 1px 1px 12px #ffbf0038, 0 0 0.5px #00000026;
}

#unlock-features-popup ul li {
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
}

#unlock-features-popup ul li::before {
	content: '\2022';
	color: #fda208;
	font-weight: bold;
	display: inline-block;
	width: 1em;
	min-width: 1em;
	margin-inline-start: 0.5em;
}

/* Text Import dialog - CSV grid (Widget.CsvGrid.ts) */
.ui-csv-grid-container {
	max-width: 700px;
	max-height: 280px;
	overflow: auto;
	border: 1px solid var(--color-border);
	background: var(--color-main-background);
	color: var(--color-main-text);
	font-family: monospace;
	font-size: 12px;
	margin-top: 8px;
}

.ui-csv-ruler-wrapper {
	position: sticky;
	top: 0;
	left: 0;
	z-index: 2;
	border-bottom: 1px solid var(--color-border);
}

.ui-csv-ruler-wrapper.fixed-mode {
	cursor: pointer;
}

.ui-csv-ruler-canvas {
	display: block;
}

.ui-csv-grid {
	border-collapse: collapse;
	table-layout: fixed;
}

.ui-csv-grid tr {
	height: var(--csv-row-height);
}

.ui-csv-grid tr.import-start {
	border-top: 2px solid var(--color-primary);
}

.ui-csv-grid th {
	padding: 2px 4px;
	border-right: 1px solid var(--color-calc-grid);
	border-bottom: 1px solid var(--color-border);
	background: var(--color-calc-header);
	font-weight: normal;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	position: sticky;
	top: 0;
	-webkit-user-select: none;
	        user-select: none;
	text-align: start;
}

.ui-csv-grid-container.fixed-mode .ui-csv-grid th {
	top: var(--csv-ruler-height);
}

.ui-csv-grid th.selected {
	background: var(--color-calc-header-selected);
}

.ui-csv-grid-row-header {
	left: 0;
	z-index: 1;
}

.ui-csv-grid-row-number {
	padding: 1px 4px;
	border-right: 1px solid var(--color-calc-grid);
	background: var(--color-calc-header);
	color: var(--color-text-lighter);
	text-align: right;
	-webkit-user-select: none;
	        user-select: none;
	position: sticky;
	left: 0;
}

.ui-csv-grid-cell {
	padding: 1px 4px;
	border-right: 1px solid var(--color-calc-grid);
	overflow: hidden;
	white-space: nowrap;
}

.ui-csv-grid-cell.selected {
	background: var(--color-calc-header-selected);
}

.ui-csv-grid-cell.dimmed {
	color: var(--color-text-lighter);
}

/* Column-type popup menu (positioned in JS via inline left/top) */
.ui-csv-context-menu {
	position: fixed;
	z-index: 10000;
	background: var(--color-main-background);
	color: var(--color-main-text);
	border: 1px solid var(--color-border);
	border-radius: 3px;
	box-shadow: 0 2px 8px var(--color-box-shadow, rgba(0, 0, 0, 0.25));
	padding: 4px 0;
	min-width: 140px;
	font-family: sans-serif;
	font-size: 13px;
}

.ui-csv-menu-item {
	padding: 4px 14px;
	cursor: pointer;
	white-space: nowrap;
	-webkit-user-select: none;
	        user-select: none;
}

.ui-csv-menu-item:hover {
	background: var(--color-background-hover, var(--color-background-lighter));
}

.ui-csv-grid-col-header:focus-visible,
.ui-csv-ruler-canvas:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
}

/* Spelling dialog - error sentence (Widget.SpellSentence.ts) */
.ui-spell-sentence {
	min-height: calc(1.4em * 4);
	max-height: 160px;
	overflow: auto;
	padding: 4px 6px;
	border: 1px solid var(--color-border);
	background: var(--color-main-background);
	color: var(--color-main-text);
	white-space: pre-wrap;
	overflow-wrap: break-word;
	line-height: 1.4;
	cursor: text;
	outline: none;
}

.ui-spell-sentence:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
}

.ui-spell-sentence .ui-spell-field {
	background: rgba(127, 127, 127, 0.2);
	border-radius: 2px;
}

/* Editor over an engine-side EditEngine (Widget.EditEngine.ts) */
.ui-editengine {
	width: 100%;
	height: 100%;
	overflow: auto;
	padding: 6px 8px;
	background: var(--color-main-background);
	color: var(--color-main-text);
	white-space: pre-wrap;
	overflow-wrap: break-word;
	line-height: 1.4;
	cursor: text;
	outline: none;
	/* The notespanel styles make this a flex box, so stack the paragraphs in a column. */
	flex-direction: column;
}

.ui-editengine.ui-editengine-placeholder {
	color: var(--color-text-placeholder);
}

.ui-editengine:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
}

/* The fill the canvas draws for a text selection in the slide. */
.ui-editengine::selection,
.ui-editengine *::selection {
	background: rgba(var(--doc-type), 0.25);
}

/* The selection of the editor while its context menu has the focus. It has the fill of the
   selection above. */
/* stylelint does not know the ::highlight pseudo yet. */
/* stylelint-disable selector-pseudo-element-no-unknown */
::highlight(editengine-menu-selection) {
	background: rgba(var(--doc-type), 0.25);
}
/* stylelint-enable selector-pseudo-element-no-unknown -- turn the check back on */

.ui-editengine .ui-editengine-paragraph {
	min-height: 1.4em;
	/* Each paragraph keeps the height of its text when the text is taller than the editor, and the
	   editor scrolls. */
	flex-shrink: 0;
}

.ui-editengine .ui-editengine-paragraph[data-bullet]::before {
	content: attr(data-bullet);
	-webkit-user-select: none;
	        user-select: none;
	opacity: 0.7;
	margin-inline-end: 0.25em;
	/* Render the bullet in the app font, which has the glyph, not the paragraph's document font. */
	font-family: var(--cool-font);
}

/* Another user edits the text, so this view only shows it. The name comes first, marked with the
   color of that user. */
.ui-editengine[data-locked-by] {
	cursor: default;
}

.ui-editengine[data-locked-by]::before {
	content: attr(data-locked-by);
	display: block;
	margin-bottom: 4px;
	padding-inline-start: 6px;
	border-inline-start: 3px solid var(--editengine-locked-color, var(--color-primary));
	color: var(--color-main-text);
	font-family: var(--cool-font);
	font-style: italic;
	-webkit-user-select: none;
	        user-select: none;
}

.ui-editengine .ui-editengine-spell-error {
	text-decoration-line: underline;
	text-decoration-style: wavy;
	text-decoration-color: var(--color-error);
	-webkit-text-decoration-skip-ink: none;
	        text-decoration-skip-ink: none;
}

/* clipboard warning dialog */
#modal-dialog-copy_paste_download_progress .ui-dialog-content {
	width: 450px;
}

/* Calc -> Insert -> Pivot Table */
#PivotTableLayout #box2 {
	grid-gap: var(--spacing-l); /* make space for vertical separator */
}

/* Modal info with 2 line message*/
.jsdialog-container [id^='info-modal-label'] {
	display: flex;
}

/* Text to Columns: keep "Column type" label and dropdown together at the left */
#TextImportCsvDialog #box5 {
	justify-content: start;
}

/* DocumentPropertiesDialog Custom props */
#DocumentPropertiesDialog #headerbox,
#DocumentPropertiesDialog #properties > .jsdialog.ui-grid {
	/* Name | Type | Value | Remove(X). The Type dropdown only needs to fit
	   "DateTime"/"Duration", and the value column must be allowed to shrink
	   (minmax(0, 1fr)) so the row never overflows and clips the X button. */
	grid-template-columns: 128px 75px minmax(0, 1fr) 26px !important;
	column-gap: 8px !important;
	align-items: center;
	margin-block-start: 4px;
}

/* Keep the list at the viewport width rather than the widest row's content
   width, so the rows - and the Remove (X) button at their right edge - are not
   clipped by the scroll viewport. */
#DocumentPropertiesDialog #scroll > .ui-scrollwindow-content {
	width: 100% !important;
	min-width: 0 !important;
}

/* The Remove (X) button is icon-only. Override the generic has-img button
   layout (a 24px+1fr grid that is width:100% with a 2px margin) which makes the
   button wider than its narrow column, so it overflows to the right and gets
   clipped. Render it as a centered icon that fits the column instead. */
#DocumentPropertiesDialog #properties [id^='remove'] button.jsdialog.has-img {
	display: flex !important;
	width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 2px !important;
}

/* The line widgets must shrink to / fill their grid column instead of rendering
   at their natural content width: the desktop builder gives the Type dropdown
   and the value fields a preferred width, so without this the Type <select>
   overflows its column (pushing the value field and the Remove (X) button out
   of view) and the text value leaves a gap before the X. */
#DocumentPropertiesDialog #properties .ui-listbox-container,
#DocumentPropertiesDialog #properties .ui-listbox-container > .ui-listbox,
#DocumentPropertiesDialog #properties .ui-edit-container,
#DocumentPropertiesDialog #properties .ui-edit-container > .ui-edit {
	min-width: 0;
	width: 100% !important;
	max-width: none !important;
}

/* Duration value: let the entry take the space and keep the edit (...) button
   beside it (it was being squeezed to nothing), with a small gap between them. */
#DocumentPropertiesDialog #properties [id^='durationbox'] {
	grid-template-columns: minmax(0, 1fr) auto !important;
	column-gap: 8px !important;
}

/* The edit inputs default to content-box, so a 100%-wide field is really
   100% + padding + border and overflows its cell, colliding with the next
   widget (Remove button, duration edit button) and eating the column gap.
   Make them border-box - matching .ui-listbox/.ui-combobox/.ui-textarea - so
   they fit their cell and the gaps are respected. */
#DocumentPropertiesDialog .ui-edit {
	box-sizing: border-box;
}

#DocumentPropertiesDialog #properties > .jsdialog.ui-grid > .ui-grid-cell > .ui-grid-cell {
	align-items: center;
	grid-column-gap: var(--spacing-s);
}

#DocumentPropertiesDialog #image-preferred-dpi-combobox + .ui-text {
	margin-inline-start: var(--spacing-s);
}

#DocumentPropertiesDialog #customprops button {
	line-height: 16px;
	width: 100%;
	margin: 0;
}

#DocumentPropertiesDialog #customprops #CustomInfoPage > .jsdialog.ui-scrollwindow:not(.formulabar) {
	height: 540px;
	max-height: none;
}

/* Description tab: let the value column shrink as well as grow. A bare 1fr
   track keeps its min-content size, so the multiline Comments field would
   otherwise force the whole grid wider than the dialog and add a needless
   horizontal scrollbar. */
#DocumentPropertiesDialog #DescriptionInfoPage .ui-grid {
	grid-template-columns: auto minmax(0, 1fr) !important;
}

#ServerAuditDialog #ServerAuditDialog-mainbox {
	min-width: min(600px, calc(0.8 * var(--dialog-available-width)));
}

#ServerAuditDialog .ui-treeview {
	border-color: transparent;
	max-height: max-content;
}
#ServerAuditDialog .ui-treeview td[role='gridcell'] {
	padding-inline-start: 0;
}
#ServerAuditDialog div:first-child .ui-treeview-header-sort-icon:after {
	display: none;
}
#ServerAuditDialog div:first-child .ui-treeview-header-sort-icon {
	background: url('images/lc_serverauditheader.svg') no-repeat center;
	width: 16px;
	display: table-caption;
	height: 16px;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label {
	display: flex;
	align-items: center;
	gap: var(--spacing-s);
	color: #000;
	border-radius: 30px;
	width: fit-content;
	height: 16px;
	margin-top: 8px;
	padding-right: 10px;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditsuccess {
	background-color: #c4f7cc;
	color: #1c4f26;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditerror {
	background-color: #ffd6d9;
	color: #d42314;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditsuccess::before {
	background: url('images/circle-check.svg') no-repeat center/18px;
	content: '';
	width: 16px;
	height: 16px;
}

#ServerAuditDialog #ServerAuditDialog-mainbox label#auditerror::before {
	background: url('images/monochrome-x-cross.svg') no-repeat center;
	content: '';
	width: 16px;
	height: 16px;
}

#findreplacetabbox {
	justify-content: start;
}

/* The hidden search icon keeps its place, so the row of the search message is as tall without a
   message as with one, and the buttons below it stay where they are. */
#FindReplaceDialog #searchbox > #searchicon.hidden {
	display: block !important;
	visibility: hidden;
}

#showcomments-container[default-state='true'],
#insertmode-container[default-state='true'],
#permissionmode-container[default-state='true'],
#documentstatus-container[default-state='true'],
#statusselectionmode-container[default-state='true'] {
	display: none !important;
}

.status-hidden {
	display: none !important;
}

/* Writer - Format - Page Style - Borders - Presets and Shadow Style - Position */
/* Calc - Format - Format Page - Borders - Presets and Shadow Style - Position */
#BorderPage.jsdialog #presets.ui-iconview,
#BorderPage.jsdialog #shadows.ui-iconview {
	grid-template-columns: 1fr 1fr 1fr 1fr 1fr; /* we want presets and shadows in a single row */
	overflow: visible;
}

/* Impress - Sidebar - Layouts */
/* Impress - Layout - Slide Transition */
[data-theme='dark'] .sidebar-panel #layoutpanel_icons .ui-iconview-entry img,
[data-theme='dark'] .sidebar-panel #transitions_icons .ui-iconview-entry img {
	filter: invert(1);
}

/* Impress - Sidebar - Layouts */
/* Draw - Insert - Fontwork */
.sidebar-panel #layoutpanel_icons .ui-iconview-entry img,
#FontworkGalleryDialog .ui-iconview-entry img {
	padding: 5px 0;
}

/* Writer - Format - Page Style - Area - Image */
#ImageTabPage #frame1 .ui-grid-cell {
	display: grid;
	grid-gap: var(--spacing-s);
}

/* Calc - Format - Format Cells - Background - Color */
/* Format -> Character -> Font Effects -> Font color */

[id^='ColorFillPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview,
[id^='ColorPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview,
:is([id^='colorwindow_iv_colors'], [id^='colorwindow_iv_recentcolors']).ui-iconview {
	grid-template-columns: repeat(12, 1fr);
	width: max-content;
	line-height: 0;
	padding: 5px;
}

[id^='ColorFillPage'].jsdialog [id^='iconview_colors'].ui-iconview,
[id^='ColorPage'].jsdialog [id^='iconview_colors'].ui-iconview,
[id^='colorwindow_iv_colors'].ui-iconview {
	max-height: calc(0.25 * var(--dialog-available-height));
}

[id^='ColorFillPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview .ui-iconview-entry :is(img, span),
[id^='ColorPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview .ui-iconview-entry :is(img, span),
:is([id^='colorwindow_iv_colors'], [id^='colorwindow_iv_recentcolors']) .ui-iconview-entry img {
	padding: 1px;
}

[id^='ColorFillPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview .ui-iconview-entry:is(:hover, .selected),
[id^='ColorPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview .ui-iconview-entry:is(:hover, .selected),
:is([id^='colorwindow_iv_colors'], [id^='colorwindow_iv_recentcolors']) .ui-iconview-entry:is(:hover, .selected) {
	outline: 2px solid var(--color-primary);
	border: 1px solid transparent;
	background-color: transparent;
	border-radius: 0;
}

[id^='ColorFillPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview .ui-iconview-entry span,
[id^='ColorPage'].jsdialog :is([id^='iconview_colors'], [id^='iconview_recent_colors']).ui-iconview .ui-iconview-entry span,
:is([id^='colorwindow_iv_colors'], [id^='colorwindow_iv_recentcolors']) .ui-iconview-entry span {
	font-size: 0; /* Hide placeholder text to prevent layout shifts in color palette iconview widgets due to lazy loading */
}

/* The color column takes the space left of the 242px right column. */
#colorpanels.ui-grid-cell {
	grid-template-columns: 1fr 242px;
}

#paletterow.ui-grid-cell,
#PatternStylePage.ui-grid-cell,
#custompalettebox.ui-grid-cell {
	display: grid;
}

/* The custom palette buttons are stacked, each as wide as the column, with the label at the start. */
#custompalettebox .ui-pushbutton-wrapper,
#custompalettebox .ui-pushbutton {
	width: 100%;
	margin: 0;
	justify-content: start;
	text-align: start;
	white-space: nowrap;
}

#custompalettebox .ui-pushbutton.has-img {
	gap: var(--spacing-s);
}

#custompalettehelp {
	line-height: var(--spacing-xl);
}

#patternbox #fillbuttonbox {
	margin-top: var(--spacing-m);
	margin-bottom: var(--spacing-xl);
}

#PatternStylePage #patternstyle,
#fillbuttonbox .ui-pushbutton {
	margin: 0;
}

/* The preview id takes a number when another page of the dialog has a preview too. */
[id^='ColorFillPage'] > .ui-drawing-area-container {
	width: auto;
	contain: inline-size;
	overflow: hidden;
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
}

[id^='ColorFillPage'] > .ui-drawing-area-container img {
	display: block;
	width: 100%;
}

/* A row of one button is drawn as the button alone, so Custom color is placed at the start too. */
#fillbuttonbox.ui-grid-cell,
#colorbuttonbox.ui-grid-cell,
[id^='ColorFillPage'] > #customcolor.ui-pushbutton-wrapper {
	justify-content: start;
}

[id^='ColorFillPage'] #customcolor-button.has-img {
	gap: var(--spacing-s);
}

/* The fill pages start right under their tabs, or at the top when the tabs are hidden. This holds
   for the tab content of a dialog with an Area page too, so its pages keep one top edge. */
#nbFillType > .ui-tabs-content,
[id^='FillEffectsDialog'] #tabcontrol > .ui-tabs-content,
.ui-tabs-content:has(> .ui-content #nbFillType) {
	margin-top: 0;
}

/* Area - Pattern Style dropdown: the shipped patterns in rows of four */

[id^='patternstylelist'].ui-iconview {
	grid-template-columns: repeat(4, 1fr);
	gap: var(--spacing-m);
	width: max-content;
	padding: 8px;
}

/* Writer - Format - Character */
/* Writer - Format - Paragraph */
/* Writer - Format - Page Style */

#ParagraphPropertiesDialog #ParaIndentSpacing #maingrid,
#ParagraphPropertiesDialog #labelTP_NUMPARA #NumParaPage,
#ParagraphPropertiesDialog #labelTP_DROPCAPS #maingrid52,
#ParagraphPropertiesDialog #transparence #box1,
#CharacterPropertiesDialog #fonteffects #FontColor,
#CharacterPropertiesDialog #fonteffects #TextDecoration,
#CharacterPropertiesDialog #fonteffects #Effects,
[id^='TemplateDialog'] #Footnote #FootnoteAreaPage {
	width: fit-content;
}

[id^='TemplateDialog'] #Footnote #FootnoteAreaPage .menubutton {
	margin: 0;
}

#CharacterPropertiesDialog :is(#font, #fonteffects, #position, #asianlayout) img.jsdialog.ui-drawing-area {
	width: 650px;
}

#CharacterPropertiesDialog #position #box7,
#CharacterPropertiesDialog #FontColor #grid3 {
	align-items: center;
}

/* Writer - Format - Paragraph - Tabs */
#ParagraphPropertiesDialog #labelTP_TABULATOR #ParagraphTabsPage {
	grid-column-gap: 0;
}

/* Writer - Format - Paragraph - Tabs */
/* Writer - Format - Paragraph - Area - Color */
#ParagraphPropertiesDialog #labelTP_TABULATOR #entryED_TABTYPE_DECCHAR-input,
#ParagraphPropertiesDialog #labelTP_TABULATOR #entryED_FILLCHAR_OTHER-input,
[id^='ColorPage'].jsdialog [id^='rgbpreset'] input,
[id^='ColorPage'].jsdialog [id^='rgbcustom'] input {
	max-width: 100px;
}

/* Writer - Format - Paragraph - Area - Color */
[id^='ColorPage'].jsdialog [id^='rgbpreset'] {
	width: max-content;
}

/* Writer - Format - Page Style - Columns - Settings */

#ColumnPage.jsdialog #grid4 {
	align-items: center;
}

#ColumnPage.jsdialog #column-iconview.ui-iconview {
	grid-template-columns: repeat(5, 1fr);
	overflow: visible;
}

/* Format - Bullets and Numbering */

#BulletsAndNumberingDialog
:is(#pick_bullet_iconview,
#pick_numbering_iconview,
#pick_outline_iconview,
#pick_graphic_iconview).jsdialog.ui-iconview {
	grid-template-columns: repeat(4, 1fr);
}

#BulletsAndNumberingDialog #PickBulletPage #changeBulletBtn.jsdialog.ui-grid-cell {
	justify-content: flex-end;
}

#BulletsAndNumberingDialog #pick_graphic_iconview.jsdialog.ui-iconview {
	min-width: 650px;
}

#BulletsAndNumberingDialog #PickGraphicPage.jsdialog #pick_graphic_iconview.ui-iconview .ui-iconview-entry span {
	font-size: 0; /* Hide placeholder text to prevent layout shifts in image page of bullets and numbering dialog due to lazy loading */
}

#BulletsAndNumberingDialog #NumberingPositionPage #previewwin.jsdialog img.jsdialog.ui-drawing-area {
	width: 370px;
}

/* Format - Bullets and Numbering - Select image as bullet -> Go to Customize */
#BulletsAndNumberingDialog #customize #bitmap-button.unobutton {
	width: fit-content; /* makes button text visible*/
}

/* Insert - Line - Sidebar - Line Style */
/* Insert - Line - Sidebar - Thickness */
#floating_line_style_iconview.ui-iconview.jsdialog,
#line_iconview.ui-iconview.jsdialog {
	grid-template-columns: 1fr; /* we want line style in a single column */
}

/* Insert - Line - Sidebar - Arrow Styles */
#floating_line_end_iconview.ui-iconview.jsdialog {
	grid-template-columns: 1fr 1fr;
}

/* Insert - Line - Sidebar - Line Style */
/* Insert - Line - Sidebar - Arrow Styles */
#floating_line_style_iconview.ui-iconview.jsdialog,
#floating_line_end_iconview.ui-iconview.jsdialog {
	font-size: 0; /* Hide placeholder text to prevent layout shifts due to lazy loading */
}

:is(#floating_line_style_iconview, #floating_line_end_iconview, #line_iconview).ui-iconview .ui-iconview-entry {
	border: 1px solid transparent !important; /* Prevents layout shift by reserving space for the border on hover */
}

/* Select Chart - Sidebar - Edit Object - Colors */
:is(#colorful_palettes, #monochromatic_palettes) .ui-iconview-entry {
	border: 1px solid transparent;
}

/* Calc - Insert - Chart - Chart Wizard(Data series) */

#CHART2_HID_SCH_WIZARD_ROADMAP #tp_DataSource #box1.jsdialog.ui-grid-cell {
	align-items: start;
}

#CHART2_HID_SCH_WIZARD_ROADMAP #tp_DataSource #grid2 :is(#box5, #box6) {
	align-items: center;
}

/* Calc - Insert - Chart - Chart Wizard */
#subtype_iconview.jsdialog.ui-iconview {
	grid-template-columns: repeat(4, 1fr);
	overflow: visible;
}

#CHART2_HID_SCH_WIZARD_ROADMAP.vertical.jsdialog label {
	width: max-content;
}

/* Listbox UI grid */
/* exclude text/bg color-picker: it's not a scolling list */
/* and exclude the context menu and its submenus, whose placement keeps them inside the window: */
.jsdialog.ui-grid[role='listbox']:not(:has(> .ui-iconview)):not(:has(> .ui-color-picker)):not([id^='jsd-context-menu-entries']) {
	max-height: min(470px, calc(0.45 * var(--dialog-available-height)));
}

.jsdialog.ui-grid[role='listbox'] {
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: var(--scrollbar-width);
	scrollbar-color: var(--scrollbar-color);
}

/* Writer - Form - Properties(Dropdown) */
#ContentControlDialog #tabindexlabel {
	width: max-content;
}

/* Prevents adding empty space on top of tabpages */
/* i.e Writer - Format - Page Style */
.single-child-grid {
	align-self: start;
}

/* Apply label styling to static text for consistent appearance */
.static-label {
	margin: auto 0px;
	color: var(--color-main-text);
	font-size: var(--default-font-size);
	line-height: var(--default-height);
	padding-left: inherit;
}

/* SPIF/STANAG security-label dialog: validation warning on its own line, in red */
#seclabelwarning.static-label {
	display: block;
	margin-top: 6px;
	color: #cc0000;
}

/* Theme Color Edit: keep color labels on one line */
#ThemeColorEditDialog .static-label {
	white-space: nowrap;
}

#sheets-buttons-toolbox #sheetlist.menubutton:hover {
	border: 1px solid var(--color-btn-border);
	background-color: var(--color-background-tabs-group);
}

#sheetlist-entries .ui-combobox-entry.selected span {
	background-color: rgba(var(--doc-type)) !important;
	color: var(--color-primary-text) !important;
	border: 1px solid rgba(var(--doc-type)) !important;
}

#sheets-buttons-toolbox #sheetlist.menubutton {
	padding: 0;
	margin: 0;
	box-sizing: inherit;
}

#sheetlist .arrowbackground {
	display: none;
}

#sheets-buttons-toolbox #sheetlist-button img {
	margin-inline-end: 0;
}

div [id^='themeview'] {
	grid-template-columns: 1fr 1fr;
	width: 420px;
}
div [id^='themeview1col'] {
	grid-template-columns: 1fr;
	width: 220px;
}

div [id^='themeview'].ui-iconview-entry, div [id^='themeview1col'].ui-iconview-entry {
	width: 200px;
	height: 146px
}

#SpecialCharactersDialog #showcharset.jsdialog.ui-iconview {
	grid-template-columns: repeat(16, 1fr);
}

/* Writer - Select Table Cell - Sidebar - Table - Miscellaneous - Border */
#borders.ui-iconview.one-child-popup {
	grid-template-columns: repeat(4, 1fr);
}

/* Calc - Format Cells - Borders - Line - Style */
#iconview_lines.ui-iconview {
	grid-template-columns: repeat(1, 1fr);
}

/* Writer - References - Table of Content... - Entries - Level */
#TocDialog #entries #box1 span.ui-text {
	font-weight: bold;
}

#imSetInsMode {
	content: url('images/queryinsmode.svg');
}

#ManageStylePage #box1 #desc {
	display: block;
}

/* Chart Data Table dialog */

/* Hide the fragment-based series header boxes — these are VCL child widgets
   that get serialized as part of the dialog tree; headers are rendered
   inside the TreeView column headers instead. */
#ChartDataDialog #columns,
#ChartDataDialog #colorcolumns {
	display: none !important;
}
#ChartDataDialog .ui-scrollwindow:has(#columns),
#ChartDataDialog .ui-scrollwindow:has(#colorcolumns) {
	display: none !important;
}

/* Let the datagridwin scrollwindow not constrain width — TreeView handles scrolling */
#ChartDataDialog #datagridwin.ui-scrollwindow {
	max-width: none;
	overflow-x: hidden;
}

#ChartDataDialog #datagrid.ui-treeview {
	overflow-x: auto;
	/* An intrinsic minimum lets a column grow to fit its title (bold
	   "Categories" at 125% zoom is wider than 80px); a fixed minimum would
	   let the title overflow under the next header. The 80px floor moves to
	   the header cell below. */
	grid-auto-columns: minmax(min-content, auto);
}

/* Align header text (e.g. "Categories") to bottom, matching columns with series names */
#ChartDataDialog .ui-treeview-header {
	display: flex;
	flex-direction: column;
	background-color: var(--color-background-dark);
	min-width: 80px;
	box-sizing: border-box;
}

#ChartDataDialog .ui-treeview-header .ui-treeview-header-text,
#ChartDataDialog .ui-treeview-header .ui-treeview-header-button {
	margin-top: auto;
}

/* Editable series name input in TreeView column headers */
#ChartDataDialog .ui-treeview-header-name {
	display: block;
	font-weight: normal;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	width: 100%;
	border: 1px solid var(--color-border);
	border-radius: 2px;
	padding: 1px 3px;
	font-size: var(--default-font-size);
	background: var(--color-background-lighter);
	box-sizing: border-box;
	min-width: 0;
	/* Fixed height so the header row does not jump while editing */
	height: 1.6em;
	flex: 0 0 auto;
}
/* Inline cell editing input */
#ChartDataDialog .ui-treeview-inline-edit {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	font: inherit;
	padding: var(--spacing-xs);
	margin: 0;
	border: 1px solid var(--color-primary, #005da0);
	border-radius: 2px;
	outline: none;
	background: var(--color-background-lighter, white);
}

/* Highlight selected column header */
#ChartDataDialog .ui-treeview-header.selected {
	background-color: var(--color-background-darker);
}
/* Make cell text spans fill their gridcells so empty cells are clickable and editable */
#ChartDataDialog .ui-treeview-entry .ui-treeview-cell-text {
	display: block;
	width: 100%;
	min-height: 1.4em;
}
#ChartDataDialog .ui-treeview-entry .ui-treeview-cell-text-content {
	display: inline-block;
	width: 100%;
	min-height: inherit;
}
/* In the chart data grid we navigate cell-by-cell, so the whole-row
   blue selection (.ui-treeview-entry.selected) would clash with and
   hide the active-cell marker. Neutralise the row fill here and let
   the active cell carry the highlight instead. */
#ChartDataDialog .ui-treeview-entry.selected {
	background-color: transparent;
	color: inherit;
	border-color: transparent;
}
/* Keyboard "active cell" marker. The row carries DOM focus; this
   class shows which cell within the row is currently active for
   Tab/Arrow navigation and is the target of inline editing. */
#ChartDataDialog .ui-treeview-entry > [role='gridcell'].ui-treeview-cell-active,
#ChartDataDialog .ui-treeview-entry > [role='rowheader'].ui-treeview-cell-active {
	background-color: var(--color-primary, #005da0);
	color: var(--color-text-darker, #fff);
	outline: 2px solid var(--color-primary, #005da0);
	outline-offset: -2px;
}
/* The active cell carries DOM focus; its marker above is the focus
   indicator, so suppress the browser's default ring on the cell. */
#ChartDataDialog .ui-treeview-entry > [role='gridcell']:focus,
#ChartDataDialog .ui-treeview-entry > [role='rowheader']:focus,
#ChartDataDialog .ui-treeview-entry > [role='gridcell']:focus-visible,
#ChartDataDialog .ui-treeview-entry > [role='rowheader']:focus-visible {
	outline: 2px solid var(--color-primary, #005da0);
	outline-offset: -2px;
}

/* Writer - Review - Tracking - Manage */
#writerchanges .ui-treeview-cell-text-content {
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

/* Two-card choice dialog (collab editing scenarios) */
#collab-choice-dialog {
	display: flex;
	flex-direction: column;
	padding: 32px 24px 24px;
	gap: 8px;
	max-width: 720px;
}

#collab-choice-title-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

/* Avatar + user name wrapped in a rounded pill; the rest of the title text
 * (e.g. "started editing") stays outside. */
#collab-choice-pill {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--color-border, #cecece);
	border-radius: 999px;
	padding: 3px 14px 3px 3px;
}

#collab-choice-title {
	font-size: 22px;
	font-weight: 700;
	text-align: center;
}

#collab-choice-name {
	font-size: 14px;
	font-weight: 500;
}

img#collab-choice-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

#collab-choice-subtitle {
	font-size: 14px;
	color: var(--color-text-lighter, #666);
	text-align: center;
	margin-bottom: 24px;
	max-width: 460px;
	align-self: center;
}

#collab-choice-cards {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 16px;
}

#collab-choice-cards > * {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 24px 24px 20px;
	gap: 6px;
	min-width: 240px;
	text-align: center;
	align-items: center;
	border: 1px solid var(--color-border, #cecece);
	border-radius: 8px;
	cursor: pointer;
	background: transparent;
	transition: background var(--duration-fast), border-color var(--duration-fast);
}

#collab-choice-cards > *:hover {
	background: var(--color-background-hover, #f0f0f0);
}

#collab-choice-cards > *:focus {
	outline: none;
	border-color: var(--color-primary, #1951a4);
	box-shadow: 0 0 0 2px var(--color-primary-lighter, #b9d2f5);
}

#collab-choice-cards [id$='-card-icon'] {
	width: 100%;
	max-width: 200px;
	height: auto;
	margin-bottom: 16px;
}

#collab-choice-cards [id$='-card-heading'] {
	font-size: 15px;
	font-weight: 700;
	white-space: normal;
}

#collab-choice-cards [id$='-card-description'] {
	font-size: 13px;
	color: var(--color-text-lighter, #666);
	flex-grow: 1;
	white-space: normal;
}

/* Focus indicator for listboxes and treeviews */
.ui-treeview:focus-within {
	outline: 2px solid var(--color-primary);
	outline-offset: -1px;
}

.ui-treeview.ui-treeview-tree .ui-treeview-entry:focus,
.ui-treeview.ui-treeview-tree .ui-treeview-entry:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
}

/* The shell draws the frame, title and close button, so the in-page titlebar
   and position margins fall away. */
.jsdialog-popout {
	margin: 0 !important;
}

.jsdialog-window.jsdialog-popout {
	inset: 0;
}

/* The window is opened at the size of the dialog's content and is the larger of
   the two from then on, so a window the user drags out is covered by the dialog
   rather than by a blank field. */
.jsdialog-window.jsdialog-popout > .jsdialog-container.lokdialog_container {
	inset: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

/* The measuring class is on for as long as it takes to read the size the dialog
   would like, and turns off the rules below, so the answer is the size of the
   dialog's own content rather than of the longest list in it. */
.jsdialog-window.jsdialog-popout.jsdialog-popout-measuring > .jsdialog-container.lokdialog_container {
	width: max-content;
	max-width: var(--dialog-available-width);
	height: max-content;
}

.jsdialog-window.jsdialog-popout:not(.jsdialog-popout-measuring) > .jsdialog-container.lokdialog_container {
	width: 100%;
	height: 100%;
}

/* The height comes from the window, not from the fraction of the browser window
   an in-page dialog is held to. */
.jsdialog-popout:not(.jsdialog-popout-measuring) .ui-dialog-content {
	max-height: none;
}

/* Core marks the widgets a dialog hands its spare height to. Each of them takes
   that height, and so does every container between one and the dialog itself. */
.jsdialog-popout:not(.jsdialog-popout-measuring) .jsdialog-vexpand,
.jsdialog-popout:not(.jsdialog-popout-measuring)
.jsdialog:has(.jsdialog-vexpand) {
	flex: 1 1 auto;
	align-self: stretch;
	min-height: 0;
}

/* A plain container hands its height on as a column of children. A grid does it
   through its 1fr row and a tab panel through its own height below. */
.jsdialog-popout:not(.jsdialog-popout-measuring)
.jsdialog:has(.jsdialog-vexpand):not(.ui-grid):not(.ui-content):not(
	.ui-tabs-content
):not(.ui-tabs-root) {
	display: flex;
	flex-direction: column;
}

/* The tab rail is positioned against the whole tab control, so the panel
   beside it follows the control's height instead of being a flex child. */
.jsdialog-popout:not(.jsdialog-popout-measuring)
.ui-tabs-root > .ui-tabs-content {
	height: 100%;
	min-height: 0;
}

/* The grid is as tall as the window it fills, so the marked row takes the height
   the other rows do not need. */
.jsdialog-popout:not(.jsdialog-popout-measuring)
.ui-grid:has(> .jsdialog-vexpand) {
	grid-template-rows: var(--jsdialog-filled-rows) !important;
}

/* A single-child grid has an empty cell ahead of the widget, which leaves the
   widget outside the rows the grid describes. A row hands the height straight on. */
.jsdialog-popout:not(.jsdialog-popout-measuring)
.single-child-grid:has(> .jsdialog-vexpand) {
	display: flex;
}

/* A dialog sized by its content gives every tab page the height of the tallest one. A list
   core marks to take the spare height grows into that height, down to the rows core asks
   for. */
.ui-tabpage.jsdialog:has(.jsdialog-vexpand:not(.hidden)),
.ui-tabpage
.jsdialog:has(
	.jsdialog-vexpand:not(.hidden)
):not(.ui-grid):not(.ui-tabs-content):not(.ui-tabs-root) {
	display: flex;
	flex-direction: column;
}

.ui-tabpage .jsdialog:has(.jsdialog-vexpand:not(.hidden)) {
	flex: 1 1 auto;
	align-self: stretch;
}

.ui-tabpage .single-child-grid:has(> .jsdialog-vexpand:not(.hidden)) {
	display: flex;
}

/* The list starts at the height of any dialog list. Inside a column flexbox it grows from that
   height into the spare height of the page. */
.ui-tabpage .jsdialog.ui-treeview.jsdialog-vexpand {
	flex: 1 1 auto;
	align-self: stretch;
	height: var(--treeview-list-height);
	min-height: var(--treeview-list-height);
	max-height: none;
}

/* The widget takes what the dialog's own window gives it, not the fraction of
   the browser window that keeps an in-page dialog smaller than the document. */
.jsdialog-popout:not(.jsdialog-popout-measuring) .jsdialog-vexpand {
	max-height: none;
}

/* Entries keep their own height and start at the top, so a gallery given more
   room than its entries need shows a plain gap under the last row. */
.jsdialog-popout:not(.jsdialog-popout-measuring)
.ui-iconview.jsdialog-vexpand {
	align-content: start;
	overflow-y: auto;
}

.jsdialog-popout .ui-dialog-titlebar {
	display: none;
}

.jsdialog-popout-body {
	margin: 0;
	overflow: hidden;
}
