/*
 * Styles for the slide import pane, docked beside the navigation sidebar
 * in a presentation.
 */

/* The wrapper paints the whole pane's background with the token the slide
 * navigator uses, so the two slide panels share one surface color and a
 * branding recolors them together. */
#slide-import-dock-wrapper {
	display: none;
	background: var(--color-background-lighter);
	position: relative;
	overflow: hidden;
	z-index: 990;
	height: 100%;
}

#slide-import-dock-wrapper.visible {
	display: block;
	width: var(--slide-import-width, 384px);
	border-inline-end: 1px solid var(--color-border);
}

#slide-import-panel {
	height: 100%;
	font-family: var(--cool-font);
	font-size: var(--default-font-size);
	color: var(--color-main-text);
}

/* The header at the top is the slide navigator's (navigation-header with
 * its title, expand and close button classes), so its styles live in
 * jssidebar.css and both panels stay in step. Only the pane's own content
 * below it is styled here. */

.slide-import {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.slide-import-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 4px 16px;
	box-sizing: border-box;
	gap: 8px;
}

/* The source list at the top: the presentations this document can take
 * slides from, each with what the pane says of it and a menu of what can be
 * done with it. The list keeps to a third of the pane so the slides below it
 * stay in sight, and scrolls when it holds more than that. */
.slide-import-sources {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: 1fr auto;
	/* Label and link, then the filter when there is one, then the list.
	 * minmax lets the list track shrink under its content, which is what
	 * gives it a height to scroll inside. */
	grid-template-rows: auto auto minmax(0, 1fr);
	align-items: center;
	row-gap: 6px;
	overflow: hidden;
}

.slide-import-sources-title {
	grid-area: 1 / 1;
	color: var(--color-text-dark);
	font-size: var(--default-font-size);
	font-weight: 600;
}

/* Adding a presentation reads as a link beside the list title, and as a
 * plain secondary button in the empty pane, where it is the one thing to do.
 * The link carries the shared ui-linkbutton class, which keeps the box of a
 * plain button off it; the colour of a link comes from here, over the dark
 * text that class paints. */
/* The same shape as the add link beside it: the room for the border the
 * desktop rules add on hover is there from the start, so the row does not
 * move under the pointer, and the two words it swaps between are the same
 * length so the box never changes size. */
.slide-import-show-all {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin: 0;
	padding: var(--spacing-xs) var(--spacing-s);
	border: 1px solid transparent;
	border-radius: var(--border-radius);
	background: transparent;
	color: var(--color-primary);
	font: inherit;
	cursor: pointer;
}

#slide-import-panel .slide-import-show-all:hover {
	color: var(--color-primary-dark);
	background-color: var(--color-btn-primary-hover-bg);
}

/* The label row's own controls, right of the label. */
.slide-import-sources-actions {
	grid-area: 1 / 2;
	display: flex;
	align-items: center;
	gap: var(--spacing-s);
}

.slide-import-add-link {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-s);
	flex-shrink: 0;
	margin: 0;
	padding: var(--spacing-xs) var(--spacing-s);
	/* A hovered button takes a border of its own from the desktop rules. The
	 * room for it is there from the start, so nothing below moves when the
	 * pointer arrives. */
	border: 1px solid transparent;
	border-radius: var(--border-radius);
	background: transparent;
	color: var(--color-primary) !important;
	font: inherit;
	cursor: pointer;
}

/* Both of these lost to the blanket button rules in device-desktop.css and
 * jsdialogs.css, which carry more than a dozen :not() classes each, so an
 * id decides it instead of an !important that never applied. The disabled
 * rule matters twice over: those rules test aria-disabled, so a disabled
 * link was lighting up on hover. */
#slide-import-panel .slide-import-add-link:hover {
	color: var(--color-primary-dark);
	background-color: var(--color-btn-primary-hover-bg);
}

#slide-import-panel .slide-import-add-link:disabled,
#slide-import-panel .slide-import-add-link:disabled:hover {
	color: var(--color-text-light);
	background: transparent;
	cursor: default;
}

.slide-import-add {
	display: inline-flex;
	align-items: center;
	gap: var(--spacing-s);
	margin: 0;
}

.slide-import-add:disabled {
	opacity: 0.5;
	cursor: default;
}

.slide-import-insert:disabled {
	background: var(--color-background-lighter);
	color: var(--color-text-light);
	cursor: default;
}

/* The rows scroll inside the list, so the title above them and the button
 * below them stay where they are however many files are listed. */
.slide-import-source-list {
	list-style: none;
	margin: 0;
	padding: 0;
	grid-area: 3 / 1 / 4 / 3;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: var(--spacing-s);
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: var(--scrollbar-width);
	scrollbar-color: var(--scrollbar-color);
}

/* A row draws no line of its own until the pointer is over it, so the list
 * reads as a plain list of files. The transparent border is there to keep
 * the rows where they are once one shows. */
.slide-import-source {
	background: var(--color-background-lighter);
}

/* The row is the header of the slides under it, so the two live in one
 * list item and the row carries what marks it: the hover, the accent and,
 * while its slides are on show, the sticky position. */
.slide-import-source-row {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: var(--spacing-m);
	height: var(--list-row-height);
	padding-inline: var(--spacing-m);
	box-sizing: border-box;
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
	background: var(--color-background-lighter);
}

.slide-import-source-row:hover {
	background: var(--color-background-hover);
}

.slide-import-source-row:focus-within {
	outline: 2px solid var(--color-primary);
	outline-offset: -2px;
}

.slide-import-source-main:focus-visible,
.slide-import-source-menu:focus-visible {
	outline: none;
}

#slide-import-panel .slide-import-source-main {
	flex: 1;
	min-width: 0;
	width: auto;
	height: 100%;
	display: flex;
	align-items: center;
	gap: var(--spacing-m);
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--color-text-dark);
	font: inherit;
	text-align: start;
	cursor: pointer;
}

/* The chevron is the one mark on a row that differs from the row above it,
 * and it says what a click will do. */
.slide-import-source-chevron {
	width: var(--btn-img-size-s);
	height: var(--btn-img-size-s);
	flex-shrink: 0;
	position: relative;
	transition: transform var(--duration-fast) var(--ease-standard);
}

.slide-import-source-chevron::before {
	content: '';
	position: absolute;
	inset-block-start: 4px;
	inset-inline-start: 5px;
	width: 6px;
	height: 6px;
	border: solid var(--color-text-light);
	border-width: 1.5px 1.5px 0 0;
	transform: rotate(45deg);
}

.slide-import-source.expanded .slide-import-source-chevron {
	transform: rotate(90deg);
}

/* What is picked in this source and not yet inserted. */
.slide-import-source-picked {
	flex: 0 0 auto;
	color: rgba(var(--doc-type), 1);
	font-weight: 600;
	white-space: nowrap;
}

.slide-import-source-count {
	flex: 0 0 auto;
	color: var(--color-text-light);
	white-space: nowrap;
}


.slide-import-source-name {
	flex: 1 1 auto;
	/* A name may end in an ellipsis and still be read, and it keeps the
	 * whole of the row's spare width to put that off. A number cannot: it
	 * is whole or it is wrong, so the count never shrinks. */
	min-width: 40px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.slide-import-source.active > .slide-import-source-row {
	border-inline-start: 3px solid rgba(var(--doc-type), 1);
	padding-inline-start: calc(var(--spacing-m) - 2px);
}

.slide-import-source.active .slide-import-source-name {
	font-weight: 600;
}

.slide-import-source[data-state='missing'] .slide-import-source-name,
.slide-import-source[data-state='noaccess'] .slide-import-source-name {
	color: var(--color-text-light);
}

.slide-import-source[data-state='missing'] .slide-import-source-icon,
.slide-import-source[data-state='noaccess'] .slide-import-source-icon {
	opacity: 0.5;
}

/* What the pane says of a source: an icon and a word. A linked source has the
 * icon of the link badge on its slides, and only a source that cannot be
 * reached is red. It reports and does nothing, so a click on it reaches the
 * row. */
.slide-import-source-badge {
	flex-shrink: 0;
	pointer-events: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding-inline: 10px;
	height: var(--btn-size-m);
	box-sizing: border-box;
	border: 1px solid currentColor;
	border-radius: var(--border-radius-s);
	background: var(--color-background-lighter);
	color: var(--color-main-text);
	font-weight: 500;
	white-space: nowrap;
}

.slide-import-source-badge-icon {
	display: none;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	background: no-repeat center;
	background-size: 14px 14px;
}

.slide-import-source-badge.linked .slide-import-source-badge-icon,
.slide-import-source-badge.outdated .slide-import-source-badge-icon,
.slide-import-source-badge.missing .slide-import-source-badge-icon,
.slide-import-source-badge.disconnected .slide-import-source-badge-icon,
.slide-import-source-badge.checking .slide-import-source-badge-icon {
	display: block;
}

.slide-import-source-badge.linked .slide-import-source-badge-icon {
	background-image: url('images/sc_linkedslide.svg');
}

.slide-import-source-badge.outdated .slide-import-source-badge-icon {
	background-image: url('images/sc_linkedslideoutdated.svg');
}

.slide-import-source-badge.missing .slide-import-source-badge-icon {
	background-image: url('images/sc_linkedslidebroken.svg');
}

.slide-import-source-badge.disconnected .slide-import-source-badge-icon {
	background-image: url('images/sc_linkedslidedisconnected.svg');
}

/* Checking has no state yet, so it shows a ring instead of an icon. */
.slide-import-source-badge.checking .slide-import-source-badge-icon {
	width: 10px;
	height: 10px;
	box-sizing: border-box;
	border: 2px solid currentColor;
	border-radius: 50%;
}

[data-theme='dark'] .slide-import-source-badge.linked .slide-import-source-badge-icon {
	background-image: url('images/dark/sc_linkedslide.svg');
}

[data-theme='dark'] .slide-import-source-badge.outdated .slide-import-source-badge-icon {
	background-image: url('images/dark/sc_linkedslideoutdated.svg');
}

[data-theme='dark'] .slide-import-source-badge.missing .slide-import-source-badge-icon {
	background-image: url('images/dark/sc_linkedslidebroken.svg');
}

[data-theme='dark'] .slide-import-source-badge.disconnected .slide-import-source-badge-icon {
	background-image: url('images/dark/sc_linkedslidedisconnected.svg');
}

.slide-import-source-badge.missing {
	color: var(--color-status-error);
}








/* The row is a div, so btns.css:179 now matches this button and sizes it
 * like a dialog button. An id outweighs that selector's fourteen classes
 * without an !important war. */
#slide-import-panel .slide-import-source-menu {
	flex-shrink: 0;
	position: relative;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: var(--border-radius);
	background: transparent url('images/lc_more.svg') no-repeat center;
	background-size: 20px 20px;
	cursor: pointer;
}

[data-theme='dark'] .slide-import-source-menu {
	background-image: url('images/dark/lc_more.svg');
}

/* The pane of a document that has no presentation to import from: what the
 * pane is for, and the one thing to do about it. */
.slide-import-empty {
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	padding: var(--spacing-xl);
	box-sizing: border-box;
}

/* The invitation is a block in the middle of the pane rather than a frame
 * around all of it, and grows with what it holds. */
.slide-import-empty-box {
	flex: 1;
	min-height: 320px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--spacing-l);
	padding: var(--spacing-xl);
	box-sizing: border-box;
	text-align: center;
	border: 1px solid var(--color-border);
	border-radius: var(--border-radius);
}

.slide-import-empty-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--color-background-dark);
}

.slide-import-empty-icon img {
	width: 32px;
	height: 32px;
}

.slide-import-empty-title {
	color: var(--color-text-dark);
	font-size: var(--medium-font-size);
	font-weight: 600;
}

.slide-import-empty-text {
	color: var(--color-text-light);
}

.slide-import-source-panel:empty {
	display: none;
}

/* The second section of the pane, on the divider that closes the first. The
 * name of the file and how many of its slides are picked stay on the panel
 * header below, so the label carries neither. */
.slide-import-slides-title {
	flex: 0 0 auto;
	margin-inline: calc(-1 * var(--spacing-m) * 2);
	padding: var(--spacing-m) calc(var(--spacing-m) * 2) 0;
	border-block-start: 1px solid var(--color-toolbar-border);
	color: var(--color-text-dark);
	font-size: var(--default-font-size);
	font-weight: 600;
}

.slide-import-list .slide-section-name {
	font-size: var(--default-font-size);
}

.slide-import-panel-message {
	padding: var(--spacing-m);
	color: var(--color-text-dark);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--spacing-m);
}

.slide-import-panel-message p {
	margin: 0;
}

.slide-import-panel-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-m);
}

#slide-import-panel .slide-import-panel-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0 10px;
	width: auto;
}

#slide-import-panel .slide-import-panel-action.choose {
	background-color: var(--color-background-dark);
	border-color: var(--color-border-dark);
}

#slide-import-panel .slide-import-panel-action.choose::before,
#slide-import-panel .slide-import-panel-action.retry::before {
	content: '';
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: no-repeat center / 16px;
	        mask: no-repeat center / 16px;
}

#slide-import-panel .slide-import-panel-action.choose::before {
	-webkit-mask-image: url('images/lc_open-outlined.svg');
	        mask-image: url('images/lc_open-outlined.svg');
}

#slide-import-panel .slide-import-panel-action.retry::before {
	-webkit-mask-image: url('images/lc_updateall.svg');
	        mask-image: url('images/lc_updateall.svg');
}

.slide-import-options {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-inline: -16px;
	padding: 12px 16px 0;
	border-block-start: 1px solid var(--color-border);
}

.slide-import-status {
	color: var(--color-text-light);
}

.slide-import-error {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	border: 1px solid var(--color-error);
	border-radius: var(--border-radius);
	color: var(--color-text-dark);
}

.slide-import-retry {
	margin: 0;
	min-width: 0;
}

.slide-import-keepdesign,
.slide-import-linksource {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--color-text-dark);
}

/* The options stand behind one row while they are closed, and that row says
 * what they are set to, so nothing the insert btn acts on is out of sight.
 * The id carries the button styling past device-desktop.css, jsdialogs.css
 * and btns.css, which dress any bare button between them. */
#slide-import-panel .slide-import-options-summary {
	display: flex;
	align-items: center;
	gap: var(--spacing-m);
	width: 100%;
	height: auto;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	color: var(--color-text-dark);
	font: inherit;
	text-align: start;
	cursor: pointer;
}

#slide-import-panel .slide-import-options-summary:hover {
	background: none;
	color: var(--color-text-dark);
}

#slide-import-panel .slide-import-options-summary:focus-visible {
	outline: 2px solid var(--color-primary-dark);
	outline-offset: 2px;
}

#slide-import-panel
.slide-import-options-summary[aria-expanded='true']
.slide-import-source-chevron {
	transform: rotate(90deg);
}

.slide-import-options-name {
	flex: 0 0 auto;
}

/* The line is the whole of what a closed block says, so it shortens rather
 * than pushes the row. */
.slide-import-options-state {
	flex: 1 1 auto;
	min-width: 0;
	color: var(--color-text-light);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.slide-import-options-body {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-m);
}

.slide-import-options-body[hidden] {
	display: none;
}

.slide-import-options input[type='checkbox'] {
	width: 18px;
	height: 18px;
	margin: 0;
}

.slide-import-keepdesign:has(input:disabled),
.slide-import-linksource:has(input:disabled) {
	opacity: 0.5;
	cursor: default;
}

/* Which slide an update reads. The group sits under the checkbox that turns
 * linking on, indented to it, and each option carries what happens after
 * someone edits the source. */
.slide-import-linkmode {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-s);
	margin-block-start: var(--spacing-s);
	padding-inline-start: 26px;
}


.slide-import-linkmode[hidden] {
	display: none;
}

.slide-import-linkmode .radiobutton {
	min-height: 22px;
}

/* mobilewizard.css:806 is unscoped, so it hands every radio label in the
 * product a 44px line and 4% of the row as padding. The percentage grows
 * with the pane and lands on the wrong side in a right-to-left locale.
 * Scoping that rule is the real fix. */
.slide-import-linkmode .radiobutton label {
	padding-inline-start: 0;
	line-height: 1.2;
}

/* The shared rule spaces a radio on both sides, and it carries a :not()
 * class, so the selector here needs the same weight to drop the space on
 * the left. The group's own indent carries it instead, and the glyph then
 * lines up with the consequence line below it. */
.slide-import-linkmode .radiobutton.jsdialog input[type='radio'] {
	margin: 1px 8px 1px 0;
}

.slide-import-linkmode label {
	cursor: pointer;
}


/* The slides carry the slide navigator's preview classes, so
 * partsPreviewControl.css styles the thumbnails of both panels; the rules
 * here only lay the slides out inside a source's panel. They flow into as
 * many columns as the pane fits, with the section headers taking a row of
 * their own. The scrolling is the panel frame's, so a list grows to the
 * height of its slides. */
.slide-import-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(148px, 100%), 1fr));
	align-content: start;
	gap: 16px;
	padding: var(--spacing-m);
	white-space: normal;
}

/* The shared rule insets the row by 16px, which the navigator's strip needs
 * for a gutter. Here the grid's own padding is the gutter, so the inset put
 * the header 16px inside the slides it heads, and its rule stopped short of
 * both edges. */
.slide-import-list .slide-section-header {
	grid-column: 1 / -1;
	margin-inline: 0;
}

/* The picture fills its column and keeps the slide's shape, in place of the
 * fixed width the preview classes give a thumbnail in the navigator's
 * strip. */
.slide-import-list .preview-frame {
	padding: 0;
	justify-content: stretch;
}

.slide-import-list .preview-helper,
.slide-import-list .preview-slide-number {
	display: none;
}

.slide-import-list .preview-img {
	min-width: 0;
	max-width: none;
	width: 100%;
	height: auto;
	margin: 0;
}

/* The roving tab stop sits on the frame; it shows on the thumbnail's ring,
 * where the slide navigator draws its selection. */
.slide-import-slide:focus-visible {
	outline: none;
}

.slide-import-slide:focus-visible .preview-img {
	outline-color: var(--color-primary-dark);
}

/* The thumbnail picture and its selection checkbox share this box, so the
 * checkbox sits over the picture's corner. The box takes the full column and
 * the picture fills it. */
.slide-import-thumb {
	position: relative;
	display: inline-flex;
	width: 100%;
}

/* The selection checkbox over a thumbnail's corner. A plain click on it
 * toggles that slide in and out of the selection, so the mouse builds a
 * multi-selection without a modifier key. The span is the click target,
 * larger than the drawn box so a click lands easily; the box itself is the
 * before pseudo-element, and the checked tick the after one. */
.slide-import-checkbox {
	display: none;
	position: absolute;
	/* The drawn box sits 8px inside the picture's corner: 5px of this
	 * span's own inset here, 3px more from the before pseudo-element,
	 * past the picture's 3px transparent border. */
	inset-block-start: 5px;
	inset-inline-start: 5px;
	width: 22px;
	height: 22px;
	cursor: pointer;
}

.slide-import-checkbox::before {
	content: '';
	position: absolute;
	inset: 3px;
	box-sizing: border-box;
	border: 1px solid var(--color-border);
	border-radius: 3px;
	background: var(--color-main-background);
	/* A shadow keeps the box readable over busy slide content. */
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.slide-import-checkbox.checked::before {
	border-color: rgba(var(--doc-type), 1);
	background: rgba(var(--doc-type), 1);
}

/* The tick: the bottom and end edges of a small rectangle, turned 45
 * degrees. */
.slide-import-checkbox.checked::after {
	content: '';
	position: absolute;
	inset-block-start: 5px;
	inset-inline-start: 8px;
	width: 5px;
	height: 9px;
	border: solid var(--color-primary-text);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* The checkbox shows while the pointer is over its slide or the slide holds
 * the keyboard focus, and stays on show on every slide while any slide is
 * checked, so an ongoing multi-selection keeps all of its toggles visible. */
.slide-import-slide:hover .slide-import-checkbox,
.slide-import-slide:focus .slide-import-checkbox,
.slide-import-list:has(.slide-import-checkbox.checked) .slide-import-checkbox {
	display: block;
}

/* A slide whose thumbnail has not arrived yet: the picture is a blank
 * placeholder with the slide's shape, and the shimmer plays on the
 * background showing through it. */
.preview-img.slide-import-skeleton {
	background: linear-gradient(
		90deg,
		var(--color-background-lighter) 25%,
		var(--color-background-darker) 50%,
		var(--color-background-lighter) 75%
	);
	background-size: 200% 100%;
	animation: slide-import-skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes slide-import-skeleton-shimmer {
	from {
		background-position: 200% 0;
	}
	to {
		background-position: -200% 0;
	}
}

.slide-import-footer {
	display: flex;
}

/* Whether picks that make up a whole section go in as that section or as
 * separate slides. It sits right above Insert, which it changes. */
.slide-import-section-choice {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-s);
	margin-block-end: var(--spacing-m);
}

.slide-import-section-choice[hidden] {
	display: none;
}

.slide-import-section-choice .radiobutton {
	min-height: 22px;
}

.slide-import-section-choice .radiobutton label {
	padding-inline-start: 0;
	line-height: 1.2;
	cursor: pointer;
}

.slide-import-section-choice .radiobutton.jsdialog input[type='radio'] {
	margin-block: 1px;
	margin-inline: 0 8px;
}

/* What a linked section does later, under the choice that makes one. */
.slide-import-section-choice-note {
	padding-inline-start: 26px;
	color: var(--color-text-light);
}


.slide-import-insert {
	width: 100%;
	max-width: none;
	margin: 0;
}

/* The divider between the two maximized slide grids. It sits on their
 * boundary, which starts at the middle of the document area. The docked
 * side-by-side panels have fixed widths, so no divider shows there. */
.pane-splitter {
	display: none;
	position: absolute;
	inset-block: 0;
	inset-inline-start: var(--expanded-navigation-width, 50%);
	width: 8px;
	margin-inline-start: -4px;
	z-index: 993;
	cursor: col-resize;
	touch-action: none;
}

#main-document-content.panes-expanded:has(#navigation-sidebar.visible):has(
#slide-import-dock-wrapper.visible
)
.pane-splitter {
	display: block;
}

/* A thin line down the middle of the wider drag target. */
.pane-splitter::before {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-start: 50%;
	width: 1px;
	transform: translateX(-50%);
	background: var(--color-border);
}

.pane-splitter:hover::before,
.pane-splitter.dragging::before,
.pane-splitter:focus-visible::before {
	background: var(--color-primary);
	width: 2px;
}

/* Maximized layout: the open panels cover the document area. The document
 * canvas underneath keeps rendering, so returning to the normal layout
 * needs no re-render. Each panel alone fills the whole area; with both
 * open they share it side by side, split at the divider. */
#main-document-content.panes-expanded #navigation-sidebar.visible {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	width: auto;
	z-index: 992;
}

#main-document-content.panes-expanded:has(#slide-import-dock-wrapper.visible)
#navigation-sidebar.visible {
	inset-inline-end: auto;
	width: var(--expanded-navigation-width, 50%);
}

#main-document-content.panes-expanded #slide-import-dock-wrapper.visible {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	inset-inline-end: 0;
	width: auto;
	z-index: 992;
}

/* Leave room for the navigation grid only when it is actually open; with
 * it closed the maximized import pane covers the whole document area. */
#main-document-content.panes-expanded:has(#navigation-sidebar.visible)
#slide-import-dock-wrapper.visible {
	inset-inline-start: var(--expanded-navigation-width, 50%);
}

/* The button that reopens the closed navigation sidebar floats at the start
 * of the document area. An absolutely placed child of the flex row starts at
 * the row's own edge, so with the import pane docked there the button moves
 * past the pane. While the import pane is maximized it covers the whole area,
 * so the button floats above it, in a strip the pane keeps clear at its start. */
#main-document-content:has(#slide-import-dock-wrapper.visible)
#navigator-floating-icon {
	inset-inline-start: var(--slide-import-width, 384px);
}

#main-document-content.panes-expanded:has(#slide-import-dock-wrapper.visible)
#navigator-floating-icon {
	inset-inline-start: 0;
	z-index: 993;
}

#main-document-content.panes-expanded:has(#navigator-floating-icon.visible)
#slide-import-dock-wrapper.visible {
	padding-inline-start: var(--floating-navigator-strip-width, 80px);
	box-sizing: border-box;
}

/* In the wide layout the insert button keeps the compact width of the
 * navigator's import-your-slides pill and sits centred like it, instead
 * of stretching across the whole panel. */
#main-document-content.panes-expanded .slide-import-insert {
	width: 300px;
	box-sizing: border-box;
}

#main-document-content.panes-expanded .slide-import-footer {
	justify-content: center;
}

/* The import-your-slides button row under the slide sorter. The spacing
 * lives on the button, not the row, so the row collapses to nothing when
 * the button is hidden (a Draw document, or a read-only presentation). */
#presentation-import-toolbar {
	display: flex;
	box-sizing: border-box;
}

#presentation-import-toolbar .unotoolbutton {
	flex: 1;
	margin: 4px;
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 32px;
	box-sizing: border-box;
	background-color: var(--color-background-dark);
	border: 1px solid var(--color-border-dark);
	border-radius: var(--border-radius);
	cursor: pointer;
}

#slide-import-panel .slide-import-panel-action.choose:hover,
#slide-import-panel .slide-import-panel-action.choose:focus-visible,
#presentation-import-toolbar .unotoolbutton:focus-visible,
#presentation-import-toolbar .unotoolbutton:hover {
	background-color: var(--color-background-lighter);
	border-color: var(--color-border-darker);
}

/* The icon-less button fills the whole pill as the click and keyboard
 * target. It carries no chrome of its own, so the pill background shows
 * through and the label inside it stays visible and centred. */
#presentation-import-toolbar .unotoolbutton .unobutton {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	background: transparent;
}

#presentation-import-toolbar .unotoolbutton:has(.unobutton:focus-visible) {
	outline: 2px solid rgb(var(--doc-type, 11, 135, 231));
	outline-offset: 2px;
}

#presentation-import-toolbar .unotoolbutton .unolabel {
	color: var(--color-main-text);
	cursor: pointer;
}

#presentation-import-toolbar .unotoolbutton:hover .unolabel {
	color: var(--color-text-darker);
}

/* The toolbar over the slide on show when that slide is linked to another
 * file. It floats over the top left corner of the document area, so the
 * document keeps its layout under it, and it takes only the room its
 * buttons need. The horizontal ruler shares this corner and sits at the very
 * top of the area, so the toolbar starts below the room the ruler takes. */
#slide-link-toolbar {
	position: absolute;
	top: calc(var(--ruler-height) + 8px);
	inset-inline-start: 16px;
	z-index: 13;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	border-radius: var(--border-radius-large);
	background: var(--color-background-dark);
	color: var(--color-text-dark);
	font-size: var(--default-font-size);
}

/* The link mark, the same picture the slide's thumbnail carries. */
.slide-link-toolbar-badge {
	flex: none;
	width: 32px;
	height: 32px;
	border-radius: var(--border-radius);
	background: var(--color-background-lighter) url('images/lc_inserthyperlink.svg') no-repeat center / 16px;
}

.slide-link-toolbar-title {
	font-weight: 600;
}

.slide-link-toolbar-state {
	color: var(--color-text-light);
}

/* The chevron that unfolds the actions. Folded it points into the toolbar,
 * where the actions would go; unfolded it points back the other way. Its
 * selectors carry the toolbar's id: btns.css styles every button under a div
 * that is not a .button with one long rule of many :not() classes, and only
 * an id outranks it. */
#slide-link-toolbar .slide-link-toolbar-expander {
	flex: none;
	width: 24px;
	height: 24px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: var(--border-radius);
	background: transparent url('images/unfold.svg') no-repeat center / 12px;
	transform: rotate(-90deg);
	cursor: pointer;
}

#slide-link-toolbar.expanded .slide-link-toolbar-expander {
	transform: rotate(90deg);
}

[dir='rtl'] #slide-link-toolbar .slide-link-toolbar-expander {
	transform: rotate(90deg);
}

[dir='rtl'] #slide-link-toolbar.expanded .slide-link-toolbar-expander {
	transform: rotate(-90deg);
}

#slide-link-toolbar .slide-link-toolbar-expander:hover,
#slide-link-toolbar .slide-link-toolbar-expander:focus-visible {
	background-color: var(--color-background-lighter);
}

/* The shared secondary button, with its picture before its label and the
 * toolbar's own spacing. It is lighter than the toolbar behind it, which the
 * shared rule paints the same shade. */
#slide-link-toolbar .slide-link-toolbar-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0 10px;
	background-color: var(--color-background-lighter);
}

#slide-link-toolbar .slide-link-toolbar-action:disabled {
	opacity: 0.5;
	cursor: default;
}

#slide-link-toolbar .slide-link-toolbar-action::before {
	content: '';
	display: block;
	width: 16px;
	height: 16px;
	background: no-repeat center / 16px;
}

#slide-link-toolbar .slide-link-toolbar-action.unlink::before {
	background-image: url('images/lc_removehyperlink.svg');
}

#slide-link-toolbar .slide-link-toolbar-action.update::before,
#slide-link-toolbar .slide-link-toolbar-action.update-section::before {
	background-image: url('images/lc_updateall.svg');
}

[data-theme='dark'] .slide-link-toolbar-badge {
	background-image: url('images/dark/lc_inserthyperlink.svg');
}

[data-theme='dark'] #slide-link-toolbar .slide-link-toolbar-expander {
	background-image: url('images/dark/unfold.svg');
}

[data-theme='dark'] #slide-link-toolbar .slide-link-toolbar-action.unlink::before {
	background-image: url('images/dark/lc_removehyperlink.svg');
}

[data-theme='dark'] #slide-link-toolbar .slide-link-toolbar-action.update::before,
[data-theme='dark'] #slide-link-toolbar .slide-link-toolbar-action.update-section::before {
	background-image: url('images/dark/lc_updateall.svg');
}
