/* general */

.sidebar * {
	font-family: var(--cool-font);
	text-transform: none !important;
	color: var(--color-main-text);
}

div.ui-grid-cell.sidebar.jsdialog {
	row-gap: 5px;
}

img.sidebar.ui-image {
	/* Images that are not buttons (e.g. spinfield)
	   16px + 6px + 6px = 28px, same height as grid cell */
	padding: 6px;
}

/* Impress -> Master Slides images should fit in the visible width */
#SdLayoutsPanelPanelExpander img.sidebar.ui-drawing-area {
	width: 300px;
}

#SdMasterPagesDeck .ui-iconview-entry img {
	width: 90%;
	height: 44px;
}

/* The iconview wrappers must fill the sidebar too, or the grid inside them
   (width:100%) only fills a narrow box and collapses to one column. */
#transitions_icons-iconview-list.sidebar,
#transitions_icons-iconview-list-window.sidebar,
#transitions-panel-button.sidebar {
	width: 100%;
}

#transitions_icons-iconview-list-buttons-container.sidebar,
#transitions-group-bottom.sidebar {
	display: none;
}

#apply_to_all-button.sidebar {
	padding: 12px;
	margin: 12px;
}

#layoutpanel_icons {
	width: 100%;
}

.sidebar.ui-grid {
	row-gap: var(--spacing-m);
}

.sidebar .ui-content .unobutton {
	box-sizing: border-box;
	margin: 0;
}

#document-container:not(.mobile) + #sidebar-dock-wrapper,
#document-container:not(.mobile) + #navigator-dock-wrapper {
	padding: 0;
	box-sizing: border-box;
}

[data-userinterfacemode='classic'] #document-container:not(.mobile) + #sidebar-dock-wrapper,
[data-userinterfacemode='classic'] #document-container:not(.mobile) + #navigator-dock-wrapper,
[data-docType='spreadsheet'] #document-container:not(.mobile) + #sidebar-dock-wrapper,
[data-docType='spreadsheet'] #document-container:not(.mobile) + #navigator-dock-wrapper {
	border-inline-start: 1px solid var(--color-border);
}
.sidebar .menu-entry-icon {
	width: var(--btn-size);
	height: var(--btn-size);
}


/* expander section header */

.sidebar.ui-expander {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.sidebar.ui-expander-btn {
	background: transparent;
	border: none;
	padding-inline-end: 2px;
	display: flex;
	align-items: center;
}

.sidebar.ui-expander-label {
	color: var(--color-main-text);
	font-size: var(--header-font-size);
	line-height: var(--sidebar-header-height);
	padding-inline: 8px;
	flex: 1;
	display: flex;
}

.ui-expander-icon-right .sidebar.unotoolbutton,
.ui-expander-icon-right .ui-overflow-group-more.unotoolbutton {
	margin: 0px !important;
}

.ui-expander.jsdialog.sidebar {
	width: 100%;
}

.ui-expander-icon-right.jsdialog.sidebar .sidebar.unotoolbutton button,
.ui-expander-icon-right.jsdialog.sidebar .sidebar.unotoolbutton button img {
	width: 10px;
	height: 10px;
	padding: 0;
	margin: var(--spacing-s);
}

.ui-expander-icon-right.jsdialog.sidebar .ui-overflow-group-more.unotoolbutton,
.ui-expander-icon-right.jsdialog.sidebar .ui-overflow-group-more.unotoolbutton button,
.ui-expander-icon-right.jsdialog.sidebar .ui-overflow-group-more.unotoolbutton button img {
	width: 14px;
	height: 14px;
	padding: 0;
	margin: 0;
	border: none;
}

.ui-expander-icon-right.jsdialog.sidebar .ui-overflow-group-more.unotoolbutton button {
	opacity: 0.75;
}

.ui-expander-icon-right.jsdialog.sidebar .ui-overflow-group-more.unotoolbutton button:hover {
	opacity: 1;
}

.ui-expander.jsdialog.sidebar .ui-expander-icon-right:hover img {
	filter: none;
}

.sidebar.ui-panel-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--header-font-size);
	font-family: var(--cool-font);
	color: var(--color-main-text);
	height: 54px;
	padding: var(--spacing-xl);
	box-sizing: border-box;
}

.sidebar.ui-panel-title {
	flex: 1;
	min-width: 0;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sidebar.ui-panel-content {
	padding-inline: 10px;
	/* A panel is as wide as the deck that holds it, and its own padding comes
	   off that width. */
	width: auto;
	line-height: var(--default-height);
}

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

#softedgeframe .sidebar.ui-expander-content,
#glowframe .sidebar.ui-expander-content {
	width: 100% !important; /* frame inside frame */
}

#AlignmentPropertyPanel.sidebar.ui-grid #box3,
#ParaPropertyPanel.sidebar.ui-grid #box1.sidebar.ui-grid-cell,
#NumberFormatPropertyPanel.sidebar.ui-grid #grid1 {
	justify-content: space-between !important;
	row-gap: var(--spacing-m);
	grid-auto-flow: revert !important;
	grid-template-columns: repeat(2, auto);
}

/* label + picker for each line end, all four on a single row */
#LinePropertyPanel.sidebar.ui-grid #arrowgrid.sidebar.ui-grid {
	display: grid !important;
	grid-auto-flow: row !important;
	grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) !important;
	align-items: center;
}

#LinePropertyPanel.sidebar.ui-grid #arrowgrid .sidebar.ui-combobox {
	min-width: 0;
}

/* section content */

.sidebar.ui-expander-content {
	padding-inline: 10px;
	/* A section is as wide as the panel or the section that holds it, and each
	   level of nesting takes its own padding off that width. */
	width: auto;
	line-height: var(--default-height);
}

.sidebar.ui-grid.ui-grid-cell > div:not(.ui-treeview) {
	justify-content: start;
	display: flex;
	align-items: center;
}

div.sidebar.ui-grid-cell.checkbutton,
div.sidebar.ui-grid .checkbutton.sidebar,
#ShadowPropertyPanel #SHOW_SHADOW,
#NumberFormatPropertyPanel.sidebar.ui-grid div.sidebar.ui-grid-cell:nth-child(2n+1),
#AlignmentPropertyPanel #indentbuttons, #SidebarTextPanel.sidebar.ui-grid div.sidebar.ui-grid-cell:nth-child(2n+1),
#ParaPropertyPanel.sidebar.ui-grid div.sidebar.ui-grid-cell:nth-child(2n) {
	justify-content: start;
}

/* widgets */

.sidebar.toolbox {
	align-items: center;
}

.sidebar.spinfieldcontainer input {
	color: var(--color-text-dark);
	background-color: var(--color-background-dark);
}

.sidebar.ui-grid.ui-grid-cell .menubutton {
	justify-content: space-between;
	padding: 8px 10px;
	margin: 5px 0 !important;
}

/* #decimalplaces */
#NumberFormatPropertyPanel .jsdialog.sidebar.spinfieldcontainer {
	margin: unset;
}

/* #numberformatcombobox-input */
#NumberFormatPropertyPanel .jsdialog.sidebar.ui-listbox-container .ui-listbox {
	width: 100%;
	height: 26px;
}

/* widget width */

.sidebar.ui-pushbutton,
.sidebar.spinfield,
.sidebar.ui-listbox,
.sidebar.menubutton:not(.has-dropdown) {
	width: 121px;
}

#gradientstyle > .sidebar.ui-listbox,
#gradangle > .sidebar.spinfield,
#fontsizecombobox .sidebar.ui-listbox,
#fontsizecombobox .sidebar.ui-combobox,
#TableEditPanel .sidebar.spinfieldcontainer input,
#ParaPropertyPanel .sidebar.spinfieldcontainer input {
	min-width: 87px;
	width: 87px;
}

#fontnamecombobox > .sidebar.jsdialog.ui-listbox,
#fontnamecombobox > .sidebar.jsdialog.ui-combobox,
#applystyle > .sidebar.jsdialog.ui-listbox,
#applystyle > .sidebar.jsdialog.ui-combobox {
	width: 198px;
}

/* fixes */

.sidebar.ui-grid-cell .sidebar.ui-pushbutton {
	margin: 0;
}
.sidebar.unotoolbutton,
.ui-overflow-group-more.unotoolbutton {
	margin-right: 3px;
	padding: 0 !important;
}
.sidebar.jsdialog.checkbutton {
	font-size: var(--default-font-size);
	align-items: center;
}

.sidebar.jsdialog.checkbutton label {
	padding: 0;
	display: flex;
	line-height: 1;
	flex-direction: column;
	justify-content: center;
}

.sidebar.menubutton.has-colorpicker:hover span {
	box-shadow: revert;
}

.sidebar #FrameLineColor-button img {
	margin-bottom: -4px;
}

/* writer */

#ParaPropertyPanel.sidebar #backgroundcolor,
#PosSizePropertyPanel.sidebar #selectrotationtype {
	justify-content: end;
}
/* Fix to allow ratio to span across columns
 so Seitenverhältnis beibehalten doesn't get cropped*/
#PosSizePropertyPanel.sidebar #ratio {
	grid-column: 1 / 3;
}
#PosSizePropertyPanel.sidebar #ratio input[type='checkbox'] {
	margin-inline-start: 0;
}

#ParaPropertyPanel.sidebar #indentfieldbox,
#ParaPropertyPanel.sidebar #box3 {
	display: grid;
	justify-content: start;
	row-gap: var(--spacing-s);
}

#ParaPropertyPanel .sidebar.ui-grid-cell {
	/* Same as sidebar  button margins */
	column-gap: 5px;
}

/* Separators */
.jsdialog.sidebar.ui-separator {
	/* Hide separators for now.
	 TODO: re-test and possibily enable them with different style*/
	display: none;
}

button#button2.ui-pushbutton.jsdialog.sidebar {
	width: 151px;
	padding: var(--spacing-s);
	position: relative;
	left: -10px;
}

#TableEditPanel.sidebar.ui-grid #split_merge, #TableEditPanel.sidebar.ui-grid #select,
#TableEditPanel.sidebar.ui-grid #rowsizing, #TableEditPanel.sidebar.ui-grid #columnsizing,
#TableEditPanel.sidebar.ui-grid #misc {
	row-gap: 0px;
}

#TableEditPanel.sidebar.ui-grid label {
	text-align: left !important;
}

/* calc */

/* cell appearance use one row */
#CellAppearancePropertyPanel.sidebar div {
	grid-template-columns: repeat(5, auto) !important;
}

#table-textorientbox.sidebar .jsdialog .radiobutton {
	border: 1px solid transparent;
}

#table-textorientbox.sidebar .jsdialog input[type='radio'] {
	background: none !important;
	width: auto;
	height: auto;
}

/* fixes sidebar width in calc (textorientbox) */
#textorientbox {
	grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
	grid-gap: inherit;
}
#textorientbox button {
	padding: 0 5px !important;
	min-width: 0 !important;
	margin-inline-end: 2px !important;
	margin-inline-start: -8px !important;
	width: auto;
}

/* Charts */

.sidebar#ChartTypePanel #cmb_chartType-input,
.sidebar#ChartTypePanel #\33 dscheme-input,
.sidebar#ChartTypePanel .ui-listbox,
.sidebar#ChartTypePanel .ui-pushbutton,
.sidebar#ChartTypePanel .ui-scrollwindow,
.sidebar#ChartTypePanel #stack,
.sidebar#ChartElementsPanel .ui-listbox {
	justify-content: start;
	width: 100%;
}

/* Pass the deck height down to the panel. */
#SdCustomAnimationDeck,
#SdCustomAnimationDeck .root-container.jsdialog.sidebar,
#SdCustomAnimationDeck .vertical.jsdialog.sidebar,
#SdCustomAnimationDeck .ui-panel-container.jsdialog.sidebar,
#SdCustomAnimationDeck #CustomAnimationsPanel {
	height: 100%;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* Fill the remaining space below the header. */
#SdCustomAnimationDeck .ui-panel-content.jsdialog.sidebar {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.sidebar#CustomAnimationsPanel {
	overflow-y: auto;
}

/* Keep enough space for the settings. */
.sidebar#CustomAnimationsPanel > .ui-scrollwindow {
	flex: 0 1 auto;
	min-height: 150px;
	max-height: none;
}

.sidebar#CustomAnimationsPanel > .ui-scrollwindow:has(#bxApplied) {
	flex: 1 1 0;
	max-height: none;
}

.sidebar#CustomAnimationsPanel > .ui-scrollwindow:has(#bxApplied) > .ui-scrollwindow-content,
.sidebar#CustomAnimationsPanel #bxApplied {
	height: 100%;
	min-height: 0;
}

.sidebar#CustomAnimationsPanel #custom_animation_label_parent {
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	box-sizing: border-box;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.sidebar#CustomAnimationsPanel #custom_animation_list {
	overflow-x: auto;
}

/* Entries waiting for their rendered image do not widen the list. */
.sidebar#CustomAnimationsPanel #custom_animation_list .ui-treeview-cell-text-content:not(img):not(:empty) {
	display: inline-block;
	vertical-align: top;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Keep the list height fixed so the rows below it don't move when
   no effect is selected. */
.sidebar#CustomAnimationsPanel .ui-grid > #effect_list {
	height: 160px;
}

.sidebar#CustomAnimationsPanel .ui-grid {
	row-gap: var(--spacing-s);
}

.sidebar#CustomAnimationsPanel #EffectFragment > .hidden {
	width: 0;
	height: 0;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

/* Override the inline grid placement. */
.sidebar#CustomAnimationsPanel #dirspan {
	display: contents !important;
}

.sidebar#CustomAnimationsPanel #start_effect_list {
	grid-column: 2 / 3 !important;
}

.sidebar#CustomAnimationsPanel #EffectFragment {
	grid-area: 6 / 2 / auto / 3;
}

.sidebar#CustomAnimationsPanel #more_properties {
	grid-area: 5 / 3 / 7 / 4;
	align-self: center;
}

.sidebar#CustomAnimationsPanel #effectlabel {
	margin-block-start: 0;
	margin-block-end: auto;
}

.sidebar#CustomAnimationsPanel .ui-grid > label {
	text-align: start !important;
}

.sidebar#CustomAnimationsPanel .ui-grid > .static-label {
	padding-inline-start: 0;
}

.sidebar#CustomAnimationsPanel .ui-grid > .hidden {
	overflow: hidden;
}

.sidebar#ChartTypePanel #stack:not(.hidden) + #grid6 {
	display: block !important;
}

.sidebar#ChartTypePanel #stack.hidden + #grid6 {
	display: none;
}

.unoChartColorPalette.unotoolbutton > .unobutton {
	width: calc(3*var(--btn-size));
	height: calc(2*var(--btn-size));
}

.unoChartColorPalette.unotoolbutton > .unobutton img {
	width: calc(3*var(--btn-img-size));
	height: calc(2*var(--btn-img-size));
}


/* not available commands*/

.sidebar #orientationcontrol,
.sidebar #rotation,
.sidebar #rotatemenu {
	visibility: hidden;
}

.sidebar #orientationcontrol,
.sidebar #rotation, .sidebar #grid1-cell-5-1,
.sidebar #rotationlabel {
	height: 0;
}

/* https://github.com/CollaboraOnline/online/issues/11868 */
/* To do: to solve it on core side */
#box4 > [id^='hyphenation'] {
	display: none !important;
}

/* Navigator */

#NavigatorPanel #contentbox,
#NavigatorPanel #contenttree,
#NavigatorPanel #tree {
	position: relative;
	top: 0;
	bottom: 10px;
	border: none;
	outline: none;
}
#NavigatorPanel .ui-expander-content > .root-container.jsdialog {
	margin: 0;
}
#NavigatorPanel div {
	background-color: transparent;
}
#NavigatorPanel .ui-treeview-icon {
	width: var(--btn-img-size-s);
	height: var(--btn-img-size-s);
}
#NavigatorPanel div.selected {
	background-color: var(--color-background-dark);
	color: var(--color-primary);
}
[data-theme='dark'] #NavigatorPanel div.selected {
	color: var(--color-text-light);
}

#NavigatorPanel .ui-treeview-entry,
#NavigatorPanel .ui-treeview-expanded-content {
	margin-block-end: 8px;
}

#NavigatorPanel .ui-treeview-entry.highlighted > *:not(.ui-treeview-expander-column) {
	background-color: var(--color-treeview-highlight);
}

#NavigatorPanel .ui-treeview-entry.highlighted > :not(.ui-treeview-expander-column) * {
	color: var(--color-treeview-highlight-text);
}

.ui-treeview-expandable.highlighted .ui-treeview-cell-text {
	color: rgb(var(--doc-type)) !important;
}

#NavigatorPanel div.selected:not(.ui-treeview-expandable-with-icon):not(:empty):not([aria-level='1'])::before {
	/* good to move this into css var*/
	font-size: 17px;
	font-weight: 500;
	position: relative;
	left: -20px;
	width: 0px;
}
#NavigatorPanel .ui-treeview-cell-text {
	/* good to move this into css var*/
	font-size: 0.875rem;
	white-space: break-spaces;
}

.StyleListPanel #TemplatePanel .ui-treeview-cell-text {
	white-space: break-spaces;
}

#NavigatorPanel .ui-treeview-cell {
	/* Move this whole block away and fix in the main control */
	display: flex;
	align-items: center;
	word-break: break-word;
}

span.jsdialog.sidebar.ui-treeview-notexpandable {
	margin-left: 15px;
}

#NavigatorPanel .ui-expander {
	display: none;
}

#navigator-floating-icon {
	border: none;
	position: absolute;
	z-index: 100;
	display: none;
	margin-inline-start: 28px;
	margin-top: 28px;
}

#navigator-floating-icon > button {
	margin-top: 100px;
}

#navigator-floating-icon img {
	width: var(--btn-img-size);
	height: var(--btn-img-size);
}

#navigator-floating-icon.visible {
	display: flex;
	flex-direction: column;
}
.navigator-btn-wrapper {
	background-color: var(--color-background-lighter);
	border-radius: var(--border-radius);
	padding: var(--spacing-s);
	box-shadow: 0px 1px 3px var(--color-box-shadow);
}

.navigator-btn-wrapper:hover {
	background: var(--color-background-darker);
}

.navigator-btn-wrapper button {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
}

.navigator-btn-wrapper img {
	width: 24px;
	height: 24px;
}

/* Navigation Panel Container */
#navigation-options-wrapper {
	font-family: var(--cool-font);
}

/* Navigation Header */
.navigation-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: var(--header-font-size);
	font-family: var(--cool-font);
	color: var(--color-main-text);
	height: 54px;
	padding: var(--spacing-xl);
	box-sizing: border-box;
}

.navigator-container .ui-treeview-placeholder {
	padding: var(--spacing-xl);
}

.close-navigation-wrapper {
	display: flex;
	box-sizing: border-box;
	border: 1px solid transparent;
	border-radius: var(--border-radius);
}

/* Navigation Search Wrapper */
.navigation-search-wrapper {
	padding: 8px 8px 8px 16px;
}

.navigation-search-wrapper > .sidebar.ui-grid-cell {
	align-items: center;
	grid-template-columns: minmax(0, 1fr);
}

/* Close Button Styling */
.close-navigation-button {
	min-width: auto !important;
	width: var(--btn-img-size) !important;
	height: var(--btn-img-size) !important;
	border: none !important;
	background-image: url('images/closedoc.svg');
	background-repeat: no-repeat;
	background-size: contain;
	background-position: center;
	background-color: transparent !important;
	cursor: pointer;
	padding: 0 !important;
	margin: 0 !important;
}
[data-theme='dark'] .close-navigation-button {
	background-image: url('images/dark/closedoc.svg');
}

/* The header title takes the free space so the grid toggle and the close
 * button sit together at the trailing edge. It keeps to one line and
 * truncates with an ellipsis when the panel is too narrow for it, so the
 * buttons stay on the title's row inside the fixed-height header. */
.navigation-title {
	flex: 1;
	min-width: 0;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Maximize-to-grid toggle, next to the close button. */
.navigation-expand-button {
	min-width: auto;
	width: var(--btn-img-size);
	height: var(--btn-img-size);
	border: none;
	background-color: transparent;
	cursor: pointer;
	padding: 0;
	margin-inline-end: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--border-radius);
}

.navigation-expand-button:hover {
	background-color: var(--color-background-darker);
}

.navigation-expand-button img {
	width: var(--btn-img-size);
	height: var(--btn-img-size);
}

/* Navigation Tabs */
#navigation-options {
	display: flex;
	padding: 0 8px;
}

/* Tab Style */
#navigation-options .tab {
	flex: 0 1 auto;
	border: 1px solid transparent;
	background: transparent;
	padding: 6px 8px;
	margin: 0 4px 0 0;
	cursor: pointer;
	font-size: 0.83rem;
	border-bottom: none;
	color: var(--color-main-text);
	transition: background-color var(--duration-slow), border-color var(--duration-slow);
}
#navigation-options .tab:after {
	content: '';
	display: block;
	margin-top: 4px;
	transition: border-color var(--duration-slow);
	border-bottom: 2px solid transparent;
}

/* Hover Effect */
#navigation-options .tab:hover {
	background: var(--color-background-darker) !important;
}

/* Active/Selected Tab */
[data-bg-theme='light'] #navigation-options .tab.selected {
	color: rgba(var(--doc-type), 1) !important;
}
#navigation-options .tab.selected:after {
	border-bottom-color: rgba(var(--doc-type), 1);
}
#navigation-sidebar {
	width: var(--navigation-sidebar-width, 250px);
	display: none;
	border-inline-end: 1px solid var(--color-border);
	/* bg set in #sidebar-dock-wrapper, #navigator-dock-wrapper */
}

/* Quick Find Panel */
#quickfind-dock-wrapper #box {
	display: grid;
	grid-template-rows: 20px auto;
	margin: 4px 0px;
	grid-gap: 10px;
}

/* dynamic size is set in parent node in JS */
#quickfind-container,
#QuickFindPanel,
#quickfind-dock-wrapper #box {
	height: inherit;
}

#QuickFindPanel .ui-treeview-cell-text-content .highlighted {
	background-color: var(--color-treeview-highlight);
	color: var(--color-treeview-highlight-text);
}

#QuickFindPanel .ui-treeview-cell-text-content.page-divider {
	/* TODO The treeview entry should have disabled listeners for these items */
	color: var(--color-text-light);
}

#navigator-search-input {
	height: 24px;
	padding-inline: var(--spacing-s);
}
/* search button */
#navigator-search-button {
	margin-left: 4px;
}
#navigator-search-button button.ui-pushbutton {
	background: transparent;
	border: none;
	width: var(--btn-size);
	height: var(--btn-size);
	padding: var(--btn-padding);
}
#navigator-search-button button.ui-pushbutton:hover {
	background-color: var(--color-background-darker) !important;
}
#quickfind-dock-wrapper #box > div:nth-child(1) {
	justify-content: space-evenly;
	height: min-content;
}

/* matched count on top */
#quickfind-dock-wrapper #box .ui-text,
#quickfind-dock-wrapper #quickfind-placeholder.ui-text {
	grid-row: 1;
	height: min-content;
	font-size: var(--default-font-size);
	margin-inline: 16px;
	margin-block-start: 8px;
	color: var(--color-status-badge);
	padding-inline-start: 0;
}

#quickfind-dock-wrapper #searchfinds {
	overflow-y: auto;
	scrollbar-width: var(--scrollbar-width);
	scrollbar-color: var(--scrollbar-color);
	max-height: calc(100vh - 350px);
}

/* results */
#quickfind-dock-wrapper .ui-treeview {
	grid-row: 2;
	border-width: 1px 0px 0px;
	border-color: transparent;
	border-radius: 0px;
	margin-bottom: 100px; /* reduce size by size of controls above in the panel */
	padding-inline: 16px;
	box-sizing: border-box;
}

#quickfind-dock-wrapper .ui-treeview-entry {
	text-wrap: balance;
	word-break: break-word;
	border-bottom: 1px solid var(--color-quickfind-border);
}
#quickfind-dock-wrapper .ui-treeview-entry.selected {
	background-color: transparent;
	border-color: transparent;
	border-radius: var(--border-radius);
	outline: 2px solid rgba(var(--doc-type), 0.4);
	outline-offset: -2px;
}
#quickfind-dock-wrapper .ui-treeview-entry:has(+ .selected) {
	border-bottom-color: transparent;
}

#quickfind-dock-wrapper .ui-treeview-entry > div {
	min-height: 24px;
	padding-block-start: 8px;
}

#quickfind-dock-wrapper .ui-treeview.empty {
	border: none;
}

#quickfind-dock-wrapper #quickfind-container > [id='0'] {
	display: grid !important;
	grid-auto-flow: row !important;
	grid-template-columns: 1fr;
}

#quickfind-container #quickfindcontrols {
	position: absolute;
	top: 0;
	right: 0;
}

#quickfind-container #quickfindcontrols button img {
	width: var(--btn-img-size-m);
	height: var(--btn-img-size-m);
}

#quickfind-container #quickfindcontrols button {
	width: var(--btn-size-m);
	height: var(--btn-size-m);
	background-color: var(--color-background-lighter) !important;
}

#quickfind-container #quickfindcontrols button:hover {
	background-color: var(--color-background-dark) !important;
}

#navigation-sidebar.visible {
	display: flex;
	flex-direction: column;
	background-color: var(--color-background-lighter)
}
/* Wrapper for the Toggle Button */
#toggle-sidebar-wrapper {
	position: absolute;
	top: 15px;
	left: 10px;
}

/* Floating Toggle Button */
#toggle-sidebar-btn {
	background-color: #007bff;
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 16px;
	transition: background-color var(--duration-slow) var(--ease-standard);
}

#toggle-sidebar-btn:hover {
	background-color: #0056b3;
}
/* Styles deck */
.StyleListPanel #TemplatePanel [id='2'] button { background: transparent url('images/lc_parastyle.svg') no-repeat center; }
.StyleListPanel #TemplatePanel [id='1'] button { background: transparent url('images/lc_charstyle.svg') no-repeat center; }
.StyleListPanel #TemplatePanel [id='3'] button { background: transparent url('images/lc_framestyle.svg') no-repeat center; }
.StyleListPanel #TemplatePanel [id='4'] button { background: transparent url('images/lc_pagestyle.svg') no-repeat center; }
.StyleListPanel #TemplatePanel [id='5'] button { background: transparent url('images/lc_liststyle.svg') no-repeat center; }
.StyleListPanel #TemplatePanel [id='6'] button { background: transparent url('images/lc_tablestyle.svg') no-repeat center; }


[data-theme='dark'] .StyleListPanel #TemplatePanel [id='1'] button { background: transparent url('images/dark/lc_charstyle.svg') no-repeat center; }
[data-theme='dark'] .StyleListPanel #TemplatePanel [id='5'] button { background: transparent url('images/dark/lc_liststyle.svg') no-repeat center; }
[data-theme='dark'] .StyleListPanel #TemplatePanel [id='2'] button { background: transparent url('images/dark/lc_parastyle.svg') no-repeat center; }
[data-theme='dark'] .StyleListPanel #TemplatePanel [id='4'] button { background: transparent url('images/dark/lc_pagestyle.svg') no-repeat center; }
[data-theme='dark'] .StyleListPanel #TemplatePanel [id='3'] button { background: transparent url('images/dark/lc_framestyle.svg') no-repeat center; }
[data-theme='dark'] .StyleListPanel #TemplatePanel [id='6'] button { background: transparent url('images/dark/lc_tablestyle.svg') no-repeat center; }

/* background is always white for previews, use black text. The notebookbar
   stylesview placeholder in notebookbar.css uses the same trick on the same
   white preview background; keep the two in sync. */
[data-theme='dark'] .StyleListPanel #treeview .ui-treeview-cell-text {
	color: var(--color-main-background);
}

.StyleListPanel .ui-treeview-entry img.ui-treeview-custom-render {
	max-height: 32px;
}

.StyleListPanel #left.toolbox button {
	background-size: cover;
}

.StyleListPanel #left.toolbox img {
	visibility: hidden;
}

/* styles are always in natural color - print preview */
.StyleListPanel .ui-treeview div.ui-treeview-icon-column img {
	max-width: inherit;
}
.StyleListPanel #treeview .ui-treeview-entry img.ui-treeview-image {
	filter: none !important;
}
.StyleListPanel #treeview.ui-treeview,
.StyleListPanel #treeview.ui-treeview div {
	background-color: white !important;
}
.StyleListPanel .ui-treeview-image {
	outline: inherit;
}

#TemplatePanel #filter select {
	width: 100%;
}

/* new button icon */
#TemplatePanel #right .unotoolbutton.new button img { visibility: hidden; }
#TemplatePanel #right .unotoolbutton.new button { background: transparent url('images/lc_stylenewbyexample.svg') no-repeat center; }
[data-theme='dark'] #TemplatePanel #right .unotoolbutton.new button { background: transparent url('images/dark/lc_stylenewbyexample.svg') no-repeat center; }

/* required to dynamically resize treeviews or lists inside sidebar */
.sidebar-container, .navigator-container
.sidebar-container > .root-container.jsdialog.sidebar,.navigator-container > .root-container.jsdialog.sidebar > .root-container.jsdialog.sidebar
.sidebar-container > .root-container.jsdialog.sidebar > .vertical.jsdialog.sidebar , .navigator-container > .root-container.jsdialog.sidebar > .vertical.jsdialog.sidebar {
	height: 100%;
}

#sidebar-container,
#sidebar-container > div,
#StyleListDeck,
#StyleListDeck .root-container.jsdialog.sidebar,
#StyleListDeck .vertical.jsdialog.sidebar,
.StyleListPanel,
.StyleListPanel #content,
.StyleListPanel #TemplatePanel {
	height: 100%;
	display: flex;
	flex-direction: column;
}

#sidebar-container > div {
	display: flex !important;
}

.StyleListPanel .ui-panel-content.jsdialog.sidebar {
	height: calc(100% - 54px);
}

#TemplatePanel .sidebar .unotoolbutton {
	padding: 4px !important;
	border: 0 solid transparent !important;
	border-bottom-width: 2px !important;
	background-color: transparent !important;
	border-radius: 0 !important;
	margin: 0 5px;
}

#TemplatePanel .sidebar .unotoolbutton:hover,
#TemplatePanel .sidebar .unotoolbutton.selected {
	border-bottom-color: rgba(var(--doc-type)) !important;
}

#TemplatePanel .sidebar .ui-content.unobutton {
	width: var(--btn-size-m);
	height: var(--btn-size-m);
	background-color: transparent !important;
}

#TemplatePanel {
	display: flex;
	flex-direction: column;
}

#TemplatePanel > div#flatview,
#TemplatePanel > div#treeview {
	height: inherit;
}

#TemplatePanel #highlightstyles input {
	margin-left: 0px;
}

#ElementsDeck #elements {
	display: inline-flex;
	flex-wrap: wrap;
}

#ElementsDeck #elements .ui-iconview-separator {
	flex: 0 0 100%;
	height: 0;
	margin: var(--spacing-xs) 0;
	border: none;
	border-top: 1px solid var(--color-border-dark);
}

/* Writer - Table - Sort */
#SortDialog #box2 :is(#grid7, #grid5) {
	align-items: center;
}

/* Six is what svx/ui/defaultshapespanel.ui asks each gallery for. */
#DefaultShapesPanel .ui-iconview {
	width: auto;
	grid-template-columns: repeat(6, 1fr);
	justify-content: start;
}
