Skip to content

Build your personal knowledge base with Trilium Notes

44.0 KB
Raw Blame
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

:root {
    --dropdown-backdrop-filter: blur(20px) saturate(6);
    --dropdown-border-radius: 10px;
}

#root-widget {
    background-color: var(--root-background);
}

body.mobile #root-widget {
    background-color: var(--main-background-color);
}

body {
    --native-titlebar-darwin-x-offset: 10;
    --native-titlebar-darwin-y-offset: 12 !important;
}

/*
 * The caption buttons are centred within the overlay, so its height has to be twice the centre
 * line of the tab bar's own buttons for the two to line up. Those buttons are top-aligned
 * (`margin: 3px ... auto ...` below), so the centre line follows the tab bar height: 3 + 30/2 = 18
 * here, and 26 in the taller horizontal layout. Linux-only, as in the base stylesheet.
 */
body.platform-linux {
    --native-titlebar-height: 36 !important;
}

body.platform-linux.layout-horizontal {
    --native-titlebar-height: 52 !important;
}

body.layout-horizontal {
    --active-tab-background-color: var(--launcher-pane-horiz-background-color);
    --active-tab-hover-background-color: var(--active-tab-background-color);
    --new-tab-button-background: transparent;
    --tab-bar-height: 44px;
    --native-titlebar-darwin-x-offset: 12;
    --native-titlebar-darwin-y-offset: 14 !important;
}

body.mobile {
    --hover-item-background-color: transparent;
}

/* #region Mica */

/* Quirk: --background-material is read before "theme-supports-background-effects" class
 * is applied. Apply the matterial even if the theme doesn't support it. */
body.background-effects.platform-win32 {
    &.layout-vertical {
        --background-material: mica;
    }

    &.layout-horizontal {
        --background-material: tabbed;
    }
}

body.background-effects.platform-darwin {
    /** Reference: https://developer.apple.com/documentation/appkit/nsvisualeffectview?preferredLanguage=objc **/
    &.layout-vertical {
        --background-material: under-window;
    }

    &.layout-horizontal {
        --background-material: hud;
    }
}

body.background-effects.theme-supports-background-effects {
    --launcher-pane-horiz-border-color: var(--launcher-pane-horiz-border-color-bgfx);
    --launcher-pane-horiz-background-color: var(--launcher-pane-horiz-background-color-bgfx);
    --launcher-pane-vert-background-color: var(--launcher-pane-vert-background-color-bgfx);
    --tab-background-color: var(--window-background-color-bgfx);
    --new-tab-button-background: var(--window-background-color-bgfx);
    --active-tab-background-color: var(--launcher-pane-horiz-background-color);
    --root-background: transparent;
}

body.background-effects.theme-supports-background-effects.layout-vertical {
    --left-pane-background-color: var(--window-background-color-bgfx);
    --center-pane-background-color-bgfx: var(--center-pane-vert-layout-background-color-bgfx);
    --right-pane-background-color: var(--right-pane-background-color-bgfx);
}

body.background-effects.theme-supports-background-effects.layout-horizontal {
    --center-pane-background-color-bgfx: var(--center-pane-horiz-layout-background-color-bgfx);
    --gutter-color: var(--left-pane-background-color);
}

body.background-effects.theme-supports-background-effects,
body.background-effects.theme-supports-background-effects #root-widget {
    background: var(--window-background-color-bgfx) !important;
}

body.background-effects.theme-supports-background-effects.layout-horizontal #horizontal-main-container,
body.background-effects.theme-supports-background-effects.layout-vertical #vertical-main-container {
    background-color: var(--root-background);
}

/* Note split with background effects */
body.background-effects.theme-supports-background-effects #center-pane .note-split.bgfx {
    --note-split-background-color: var(--center-pane-background-color-bgfx);
}

/* #endregion */

#horizontal-main-container {
    /* The default start-start and end-start border radius for the note split. */
    --note-split-top-border-radius: var(--center-pane-border-radius);
    --note-split-bottom-border-radius: var(--center-pane-border-radius);
}

/* Draws the launch bar's border in the gap between the peek button and the peeked tree. The
   offset is physical, since the button is mirrored in RTL. */
body.layout-vertical #horizontal-main-container > .left-pane-peek-button.peek-pane-button-action-collapse {
    box-shadow: 2px 0 var(--left-pane-collapsed-border-color),
        2px 0 var(--launcher-pane-vert-background-color);
}

/*
 * Gutter
 */

.gutter {
    background: var(--gutter-color) !important;
    transition: background 150ms ease-out;
}

.gutter:hover {
    background: var(--gutter-hover-color) !important;
    transition: background 300ms ease-in;
}

/*
 * LAUNCHER PANE / TOOLBAR
 */

#launcher-container,
body.layout-horizontal > .horizontal {
    align-items: center;
}

/* Thin launcher-rail scrollbar; the padding below (set from the JS-measured
 * `--launcher-scrollbar-size`) offsets its width so it never shifts the centred buttons. */
#launcher-container {
    --scrollbar-thickness: 4px;
    --scrollbar-thumb-thickness: 4px;
    --scrollbar-thumb-hover-thickness: 4px;
    scrollbar-width: thin;
}

/* Style the base pseudo (forms.css styles only :vertical) so WebKit shows a persistent bar
 * instead of an auto-hiding overlay. */
#launcher-container::-webkit-scrollbar {
    width: var(--scrollbar-thickness);
    height: var(--scrollbar-thickness);
}

@supports (-webkit-box-reflect: below) {
    /* Let ::-webkit-scrollbar win over scrollbar-width on WebKit (mirrors forms.css's :root reset). */
    #launcher-container {
        scrollbar-width: unset;
    }
}

#launcher-pane.vertical {
    --launcher-pane-border-color: unset;
    --launcher-pane-background-color: var(--launcher-pane-vert-background-color);
    --launcher-pane-text-color: var(--launcher-pane-vert-text-color);
    --launcher-pane-button-hover-color: var(--launcher-pane-vert-button-hover-color);
    --launcher-pane-button-hover-background: var(--launcher-pane-vert-button-hover-background);
    --launcher-pane-button-hover-shadow: var(--launcher-pane-vert-button-hover-shadow);
    --launcher-pane-button-focus-outline-color: var(--launcher-pane-vert-button-focus-outline-color);

    --launcher-pane-size: var(--launcher-pane-vert-size);
    --launcher-pane-icon-size: var(--launcher-pane-vert-icon-size);
    --launcher-pane-button-margin: var(--launcher-pane-vert-button-margin);
    --launcher-pane-button-gap: var(--launcher-pane-vert-button-gap);

    width: var(--launcher-pane-size) !important;
    min-width: var(--launcher-pane-size) !important;
    padding-bottom: var(--launcher-pane-button-gap);
}

#launcher-pane.vertical #launcher-container {
    width: var(--launcher-pane-size);
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding-inline-start: var(--launcher-scrollbar-size, 0px);
}

#launcher-pane.horizontal {
    --launcher-pane-border-color: var(--launcher-pane-horiz-border-color);
    --launcher-pane-background-color: var(--launcher-pane-horiz-background-color);
    --launcher-pane-text-color: var(--launcher-pane-horiz-text-color);
    --launcher-pane-button-hover-color: var(--launcher-pane-horiz-button-hover-color);
    --launcher-pane-button-hover-background: var(--launcher-pane-horiz-button-hover-background);
    --launcher-pane-button-hover-shadow: var(--launcher-pane-horiz-button-hover-shadow);
    --launcher-pane-button-focus-outline-color: var(--launcher-pane-horiz-button-focus-outline-color);

    --launcher-pane-size: var(--launcher-pane-horiz-size);
    --launcher-pane-icon-size: var(--launcher-pane-horiz-icon-size);
    --launcher-pane-button-margin: var(--launcher-pane-horiz-button-margin);
    --launcher-pane-button-gap: var(--launcher-pane-horiz-button-gap);

    height: var(--launcher-pane-size) !important;
    align-items: center;
}

#launcher-pane.horizontal #launcher-container {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-block-start: var(--launcher-scrollbar-size, 0px);
}

@media (max-width: 991px) {
    #mobile-bottom-bar {
        background: var(--launcher-pane-horiz-background-color);
    }

    body.mobile #launcher-pane {
        background: transparent !important;
    }
}

@media (min-width: 992px) {
    #launcher-pane.horizontal {
        border-top: unset;
        border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
    }
}

#launcher-pane .launcher-button,
#launcher-pane .right-dropdown-widget,
#launcher-pane .global-menu {
    width: calc(var(--launcher-pane-size) - (var(--launcher-pane-button-margin) * 2)) !important;
    height: calc(var(--launcher-pane-size) - (var(--launcher-pane-button-margin) * 2)) !important;
    margin: var(--launcher-pane-button-gap) var(--launcher-pane-button-margin);
}

#launcher-pane .launcher-button {
    padding: 0 !important;
    border-radius: 8px;
    transition:
        background-color 300ms ease-out,
        color 300ms ease-out,
        box-shadow 300ms ease-out;
    cursor: default;
}

#launcher-pane .dropdown .launcher-button {
    margin: 0;
}

#launcher-pane .launcher-button:active,
#launcher-pane .launcher-button.show {
    transform: scale(0.9);
    transition: transform 50ms linear;
}

#launcher-pane .launcher-button:hover,
#launcher-pane .launcher-button.right-dropdown-button.show,
#launcher-pane.horizontal .global-menu-button:hover,
#launcher-pane.horizontal .global-menu-button.show {
    background: var(--launcher-pane-button-hover-background) !important;
    color: var(--launcher-pane-button-hover-color);
    box-shadow: var(--launcher-pane-button-hover-shadow);
    transition:
        background-color 100ms ease-in,
        color 80ms ease-in,
        box-shadow 100ms ease-in;
}

#launcher-pane .launcher-button {
    font-size: var(--launcher-pane-icon-size) !important;
}

#launcher-pane .launcher-button:focus,
#launcher-pane .global-menu :focus {
    outline: none;
}

#launcher-pane .launcher-button:focus-visible,
#launcher-pane.horizontal .global-menu button:focus-visible {
    outline: 2px solid var(--launcher-pane-button-focus-outline-color);
}

#launcher-pane.vertical .global-menu button:focus-visible svg {
    outline-offset: 4px;
    outline: 2px solid var(--launcher-pane-button-focus-outline-color);
    border-radius: 4px;
    overflow: visible;
}

#launcher-pane.vertical .spacer {
    width: var(--launcher-pane-size);
}

#launcher-pane.horizontal .spacer {
    height: var(--launcher-pane-size);
}

/* Protected session enabled button */

#launcher-pane button.bx-check-shield,
#launcher-pane button.bx-check-shield:hover {
    color: var(--protected-session-active-icon-color);
    transition: color 500ms ease-in-out;
}

/* Sync status button */

#launcher-pane .sync-status .sync-status-icon {
    top: 3px;
}

#launcher-pane .sync-status-icon:not(.sync-status-in-progress):hover {
    background: unset;
}

@keyframes sync-status-pulse {
    from {
        color: currentColor;
    }
    to {
        color: var(--pulse-color);
    }
}

#launcher-pane .sync-status-disconnected-with-changes {
    --pulse-color: var(--sync-status-error-pulse-color);
    animation: sync-status-pulse 1s steps(10, jump-none) alternate-reverse infinite;
}

#launcher-pane button.global-menu-button {
    --update-badge-x-offset: 3%;
    --update-badge-y-offset: -12%;

    --hover-item-background-color: transparent;
}

/*
 * Calendar
 */

 .calendar-dropdown-widget {
    padding: 18px;
    color: var(--calendar-color);
    user-select: none;
}

.calendar-dropdown-widget .calendar-header {
    gap: 10px;
}

.calendar-dropdown-widget .calendar-header input,
.calendar-dropdown-widget .calendar-header [data-calendar-input="month"] {
    --input-background-color: transparent;
    --menu-background-color: transparent;
}

.calendar-dropdown-widget .calendar-header input:not(:focus) {
    outline: 3px solid transparent;
}

.calendar-dropdown-widget .calendar-header .calendar-month-selector .select-button {
    --select-arrow-svg: initial; /* Disable the dropdown arrow */
}

/* Week number column */
.calendar-dropdown-widget .calendar-week-number {
    transform: rotate(270deg);
    justify-content: center;
    padding: 0;
    opacity: 0.5;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: .5pt;
}

.calendar-dropdown-widget .calendar-week-number::after {
    display: none;
}

@media (max-width: 992px) {
    .calendar-dropdown-widget .calendar-header button {
        margin: 0 !important;
        padding: 0;
    }

    .calendar-dropdown-widget .calendar-header .calendar-month-selector .select-button {
        padding: 0 8px;
        flex-grow: 1;
    }
}

@media (min-width: 992px) {
    .calendar-dropdown-widget .calendar-header .calendar-month-selector .select-button {
        min-width: 120px;
        padding: 0 10px;
    }
}

.calendar-dropdown-widget .calendar-header .dropdown-toggle::after {
    content: unset !important;
}

.calendar-dropdown-widget .calendar-week span {
    color: var(--calendar-weekday-labels-color);
}

.calendar-dropdown-widget .calendar-body {
    font-size: 0.9em;
}

.calendar-dropdown-widget .calendar-body a {
    background: transparent;
    color: var(--calendar-color);
}

.calendar-dropdown-widget .calendar-body a.calendar-date-exists {
    position: relative;
    text-decoration: none !important;
}

.calendar-dropdown-widget .calendar-body a.calendar-date-exists:not(:hover)::before {
    --vertical-margin: 13%;
    --horiz-margin: 18%;
    content: "";
    position: absolute;
    top: var(--vertical-margin);
    inset-inline-end: var(--horiz-margin);
    bottom: var(--vertical-margin);
    inset-inline-start: var(--horiz-margin);
    border-radius: 6px;
    background: var(--calendar-day-highlight-background);
    z-index: -1;
}

body .calendar-dropdown-widget .calendar-body a:hover {
    border-radius: 6px;
    background: var(--calendar-day-hover-background);
    color: var(--calendar-day-hover-color) !important;
    text-decoration: unset;
}

body .calendar-dropdown-widget .calendar-body a.calendar-date-active {
    border-radius: 6px;
    background: var(--calendar-day-selected-background);
    color: var(--calendar-day-selected-color) !important;
}

/*
 * QUICK SEARCH BOX
 */

/* The results popup is portaled to `<body>`, outside `div.quick-search`. `:root` outranks the
   popup's own rules in quick_search.css. */
:root .dropdown-menu.quick-search-menu {
    --quick-search-item-delimiter-color: transparent;
    --menu-item-icon-vert-offset: -.065em;

    /* Item */
    .dropdown-item {
        padding: 8px 12px !important;
    }

    .dropdown-item:not(.disabled):hover,
    .dropdown-item:not(.disabled):focus,
    .dropdown-item:not(.disabled):focus-visible {
        outline: none !important;
        background: var(--hover-item-background-color);
        color: var(--hover-item-text-color);
    }

    .quick-search-item-icon {
        vertical-align: text-bottom;
    }

    /* Note content snippet */
    .search-result-content {
        background-color: var(--quick-search-result-content-background);
        border-radius: 4px;
    }

    /* Highlighted search terms */
    :is(.search-result-title, .search-result-content, .search-result-attributes)
        b:not(.search-fuzzy-match) {
        color: var(--quick-search-result-highlight-color);
        font-weight: 600;
    }
}

/*
 * TREE PANE
 *
 * The tree popup editor's sidebar (`.tree-popup-sidebar`) hosts the same NoteTreeWidget outside
 * `#left-pane`, so every rule in this section matches both via `:is()` — which also keeps the
 * original id-level specificity for the popup, so these still override the base tree.css rules.
 */

:is(#left-pane, .tree-popup-sidebar) div.tree {
    padding: 3px 6px 40px 6px;
    animation: fade-in 200ms ease-in;
}

#left-pane .tree.scroll-edge-fade {
    --scroll-fade-top: 18px;
    padding-top: 10px;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node {
    border: unset;
    border-radius: 6px;
    cursor: default;
}

:is(#left-pane, .tree-popup-sidebar) .ui-fancytree ul {
    padding-inline-start: 10px;
}

/* The root element of the tree */
:is(#left-pane, .tree-popup-sidebar) .fancytree-container > li:first-child > span {
    padding-inline-start: 12px;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-active,
:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-active:hover {
    position: relative;
    background: transparent;
    color: var(--custom-color, var(--left-pane-item-selected-color));
}

@keyframes left-pane-item-select {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/*
 * .fancytree-node pseudo-elements:
 *
 *      - ::before: the active tree item decorator.
 *      - ::after:  the selected tree item background. A pseudo-element is used instead of the
 *                  element's background color, to allow alpha compositing for the hover state.
 */

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-active::before {
    position: absolute;
    content: "";
    top: var(--left-pane-item-selected-shadow-size);
    inset-inline-start: var(--left-pane-item-selected-shadow-size);
    bottom: var(--left-pane-item-selected-shadow-size);
    inset-inline-end: var(--left-pane-item-selected-shadow-size);
    background: var(--custom-bg-color, var(--left-pane-item-selected-background)) !important;
    box-shadow: var(--left-pane-item-selected-shadow);
    border-radius: 6px;
    animation: left-pane-item-select 200ms ease-out;
    z-index: -1;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected {
    --left-pane-item-selected-shadow-size: 4px;

    position: relative;
    background-color: transparent;
    border-radius: 0;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected::after {
    display: block;
    position: absolute;
    z-index: -2;
    content: "";
    inset: 0;
    background: var(--selection-background-color);
    animation: left-pane-item-select 100ms ease-out;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.protected > span.fancytree-custom-icon {
    position: relative;
    filter: unset !important;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.protected > span.fancytree-custom-icon:after {
    position: absolute;
    bottom: 0;
    inset-inline-end: 0;
    font-size: 14px;
    content: "\eb4a";
    font-family: "boxicons";
    transform: translateX(25%);
    color: var(--quick-search-result-highlight-color);
    background: var(--left-pane-background-color);
    border-radius: 50%;
}

body[dir=rtl] :is(#left-pane, .tree-popup-sidebar) span.fancytree-node.protected > span.fancytree-custom-icon:after {
    transform: translateX(-25%);
}

:is(#left-pane, .tree-popup-sidebar) .fancytree-expander,
.nested-note-list-item .note-expander {
    opacity: 0.65;
    transition: opacity 150ms ease-in;
}

:is(#left-pane, .tree-popup-sidebar) .fancytree-expander:hover,
.nested-note-list-item .note-expander:hover {
    opacity: 1;
    transition: opacity 300ms ease-out;
}

:is(#left-pane, .tree-popup-sidebar) .fancytree-custom-icon {
    margin-top: 0; /* Use this to align the icon with the tree view item's caption */
    color: var(--custom-color, var(--left-pane-icon-color));
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-active .fancytree-title {
    font-weight: normal;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node:hover {
    background: var(--left-pane-item-hover-background);
}

:is(#left-pane, .tree-popup-sidebar) .note-indicator-icon.shared-indicator {
    opacity: 0.5;
}

:is(#left-pane, .tree-popup-sidebar) .tree-item-button,
:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected .fancytree-custom-icon {
    margin-inline-end: 6px;
    border: unset;
    border-radius: 50%;
    background: var(--left-pane-item-action-button-background);
    color: var(--left-pane-item-action-button-color);
    transition:
        background-color 200ms ease-out,
        box-shadow 200ms ease-out;
}

:is(#left-pane, .tree-popup-sidebar) .tree-item-button:hover,
:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected .fancytree-custom-icon:hover {
    background: var(--left-pane-item-action-button-hover-background);
    box-shadow: var(--left-pane-item-action-button-hover-shadow);
    transition:
        background-color 100ms ease-in,
        box-shadow 100ms ease-in;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-active .tree-item-button:hover,
:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-active.fancytree-selected .fancytree-custom-icon:hover {
    box-shadow: var(--left-pane-item-selected-action-button-hover-shadow);
}

/* Selected item bulk action button */

@keyframes bulk-action-button-blink {
    from {
        opacity: 1;
    }
    to {
        opacity: .3;
    }
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected .fancytree-custom-icon {
    margin: 0;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected .fancytree-custom-icon::before {
    border: 0;
    font-size: .65em;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected:hover .fancytree-custom-icon:not(:hover)::before {
    animation: bulk-action-button-blink 500ms linear infinite alternate;
}

:is(#left-pane, .tree-popup-sidebar) span.fancytree-node.fancytree-selected.protected .fancytree-custom-icon::after {
    /* Protected note indicator */
    display: none;
}


#context-menu-container {
    /* The context menu of the tree */
    --menu-item-icon-vert-offset: -1px;
}

/*
 * Tree actions toolbar
 */

/* Toolbar container (collapsed state) */
:is(#left-pane, .tree-popup-sidebar) .tree-actions {
    max-width: var(--tree-actions-toolbar-collapsed-width);
    inset-inline-end: var(--tree-actions-toolbar-horizontal-margin);
    bottom: var(--tree-actions-toolbar-vertical-margin);
    overflow: hidden;
    border: 1px solid transparent;
    padding: var(--tree-actions-toolbar-padding-size);
    padding-inline-end: var(--tree-actions-toolbar-collapsed-width);
    background: transparent;
    transition:
        max-width 400ms ease-out,
        background-color 400ms ease-out,
        border-color 400ms ease-out;
}

/* Toolbar container (expanded state) */
:is(#left-pane, .tree-popup-sidebar) .tree-actions:hover {
    max-width: 200px;
    border-color: var(--dropdown-border-color);
    background: var(--menu-background-color);
    backdrop-filter: blur(10px) saturate(6);
    box-shadow: 0 5px 10px rgba(0, 0, 0, var(--dropdown-shadow-opacity));
}

/* Toolbar button (toolbar collapsed)*/
:is(#left-pane, .tree-popup-sidebar) .tree-actions button {
    border: unset;
    color: var(--menu-item-icon-color);
    opacity: 0;
    transition: opacity 200ms ease-out;
}

/* Toolbar button on hover */
:is(#left-pane, .tree-popup-sidebar) .tree-actions button:hover {
    background: var(--hover-item-background-color);
}

/* Toolbar button (toolbar expanded) */
:is(#left-pane, .tree-popup-sidebar) .tree-actions:hover button {
    opacity: 1;
    transition: opacity 250ms ease-in;
}

/* The floating expand button (toolbar collapsed) */
:is(#left-pane, .tree-popup-sidebar) .tree-actions::after {
    display: flex;
    content: "\eab4";
    position: absolute;
    justify-content: center;
    align-items: center;
    top: 50%;
    inset-inline-end: calc((var(--tree-actions-toolbar-collapsed-width) - var(--tree-actions-toolbar-expand-button-size)) / 2);
    width: var(--tree-actions-toolbar-expand-button-size);
    height: var(--tree-actions-toolbar-expand-button-size);
    box-shadow: 2px 2px 6px var(--left-pane-background-color);
    border-radius: 50%;
    background: var(--left-pane-item-action-button-background);
    backdrop-filter: blur(10px);
    color: var(--left-pane-item-action-button-color);
    font-family: boxicons;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-50%);
    transition: color 200ms ease-in;
}

/* The floating expand button (toolbar expanded) */
:is(#left-pane, .tree-popup-sidebar) .tree-actions:hover::after {
    background: transparent;
    color: var(--menu-item-icon-color);
    opacity: var(--menu-item-disabled-opacity);
    transition: color 200ms ease-out;
}

/*
 * TAB BAR
 */

/* The parent element of the tab bar */
#rest-pane > div.component:first-child {
    height: var(--tab-bar-height) !important;
}

.tab-row-widget,
.tab-row-container {
    background: transparent !important;
    height: var(--tab-bar-height) !important;
}

.tab-row-container .toggle-button {
    --icon-button-size: 30px;
    --icon-button-icon-ratio: .6;

    margin: 3px 6px auto 8px !important;
}

.tab-row-container {
    position: relative;
}

/* Apply a border to the tab bar that avoids the current tab but also allows a transparent active tab. */
body.layout-horizontal .tab-row-container {
    border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
}

body.electron.background-effects.layout-horizontal .tab-row-container {
    border-bottom: unset !important;
}

body.electron.background-effects.layout-horizontal .note-tab-wrapper {
    top: 1px;
}

body.electron.background-effects.layout-horizontal .tab-row-container .toggle-button {
    position: relative;
}

body.electron.background-effects.layout-horizontal .tab-row-container .toggle-button:after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: -10px;
    inset-inline-end: -6px;
    top: 32px;
    height: 1px;
    border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
}

body.electron.background-effects.layout-horizontal .tab-row-container .tab-history-navigation-buttons {
    position: relative;

    &:after {
        content: "";
        position: absolute;
        bottom: 0;
        inset-inline-start: 0;
        inset-inline-end: -7px;
        height: 1px;
        border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
    }
}

body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-left,
body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-right {
    position: relative;
}

body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-inset-inline-start:after,
body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-inset-inline-end:after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 0px;
    inset-inline-end: 0px;
    height: 1px;
    border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
}

body.electron.background-effects.layout-horizontal .tab-row-container .note-tab[active]:before {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: -32768px;
    top: var(--tab-height);
    inset-inline-end: calc(100% - 1px);
    height: 1px;
    border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
}

body.electron.background-effects.layout-horizontal .tab-row-container .note-tab[active]:after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: 100%;
    top: var(--tab-height);
    inset-inline-end: 0;
    width: 100vw;
    height: 1px;
    border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
}

body.electron.background-effects.layout-horizontal .tab-row-container .note-new-tab:before {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-start: -4px;
    top: calc(var(--tab-height), -1);
    inset-inline-end: 0;
    width: 100vw;
    height: 1px;
    border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
}

body.layout-vertical.electron.platform-darwin .tab-row-container {
    border-bottom: 1px solid var(--subtle-border-color);
}

.tab-row-widget-container {
    height: var(--tab-height) !important;
}

body.layout-vertical .tab-row-widget > * {
    margin-top: calc((var(--tab-bar-height) - var(--tab-height)) / 2);
}

body.layout-horizontal .tab-row-container {
    padding-top: calc(var(--tab-bar-height) - var(--tab-height));
}

/* Define extra drag areas for Electron windows */
body.layout-horizontal .tab-row-container,
body.layout-vertical .tab-row-widget,
body.layout-vertical #left-pane .quick-search {
    -webkit-app-region: drag;
}

/* Limit the drag area for the previous elements to include just to the element itself
   and not its descendants also */
body.layout-horizontal .tab-row-container > *,
body.layout-vertical .tab-row-widget > *:not(.tab-row-filler),
body.layout-vertical #left-pane .quick-search > * {
    -webkit-app-region: no-drag;
}

body.layout-horizontal .tab-row-widget,
body.layout-horizontal .tab-row-widget-container {
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

body.desktop:not(.background-effects) #root-widget.horizontal-layout {
    background-color: var(--root-background) !important;
}

#root-widget.horizontal-layout .tab-row-widget .note-tab .note-tab-wrapper {
    border: 1px solid transparent;
    border-bottom-color: transparent;
    box-shadow: unset;
}

#root-widget.horizontal-layout .tab-row-widget .note-tab[active] .note-tab-wrapper {
    border: 1px solid var(--launcher-pane-horiz-border-color);
    border-bottom-color: transparent;
}

:root div.tab-row-widget div.note-tab div.note-tab-wrapper {
    height: var(--tab-height) !important;
    border-radius: 8px;
    transition:
        background 75ms ease-in,
        box-shadow 75ms ease-in;
}

.tab-row-widget .note-tab .note-tab-wrapper:hover {
    transition: none;
}

body.layout-horizontal div.tab-row-widget div.note-tab div.note-tab-wrapper {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.note-tab .note-tab-wrapper {
    --tab-background-color: initial !important;
}

.note-tab .note-tab-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 3px;
    background-color: var(--workspace-tab-background-color);
}

:root .tab-row-widget .note-tab .note-tab-icon {
    padding-inline-end: 5px; /* The gap between the icon and the title */
}

.tab-row-widget .note-tab[active] .note-tab-icon {
    color: var(--active-tab-icon-color);
}

.tab-row-widget .note-tab .note-tab-title {
    text-overflow: ellipsis;
}

body.layout-vertical .tab-row-widget-is-sorting .note-tab.note-tab-is-dragging .note-tab-wrapper {
    transform: scale(0.85);
    box-shadow: var(--active-tab-dragging-shadow) !important;
}

.tab-row-widget .note-tab[active] .note-tab-wrapper {
    box-shadow: var(--active-tab-shadow);
    font-weight: unset !important;
    transition:
        background 150ms ease-out,
        box-shadow 300ms ease-out;
}

.tab-row-widget-is-sorting .note-tab-drag-handle {
    cursor: grabbing !important;
}

.tab-row-widget .note-tab-close {
    display: flex;
    justify-content: center;
    align-items: center;
    transition:
        background-color 75ms ease-out,
        color 75ms ease-out;
}

.tab-row-widget .note-tab-close:hover {
    background: var(--tab-close-button-hover-background) !important;
    color: var(--tab-close-button-hover-color) !important;
    transition-timing-function: ease-in;
}

.tab-row-widget .note-new-tab {
    position: relative;
    margin-inline-start: 3px;
    color: transparent; /* Prevent the original "+" from being displayed */
}

.tab-row-widget .note-new-tab {
    background: transparent !important;
}

.tab-row-widget .note-new-tab::before {
    /* The background circle */
    position: absolute;
    content: "";
    top: calc((var(--tab-height) - var(--new-tab-button-size)) / 2);
    inset-inline-start: calc((var(--tab-height) - var(--new-tab-button-size)) / 2);
    width: var(--new-tab-button-size);
    height: var(--new-tab-button-size);
    background: var(--new-tab-button-background);
    border-radius: 50%;
    transition:
        background-color 200ms ease-out,
        box-shadow 200ms ease-out,
        transform 300ms ease-in;
    will-change: transform;
}

.tab-row-widget .note-new-tab:hover::before {
    background: var(--new-tab-button-hover-background);
    box-shadow: var(--new-tab-button-shadow);
    transition:
        background-color 100ms ease-in,
        box-shadow 100ms ease-in;
}

.tab-row-widget .note-new-tab::after {
    /* The "X" icon */
    display: flex;
    position: absolute;
    content: "\ebc0";
    inset-inline-start: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-family: boxicons;
    font-size: calc(var(--new-tab-button-size) * 0.75);
    color: var(--new-tab-button-color);
    transition:
        color 300ms ease-out,
        transform 300ms ease-in;
    will-change: transform;
}

.tab-row-widget .note-new-tab:hover::after {
    color: var(--new-tab-button-hover-color);
    transition: color 100ms ease-in;
}

.tab-row-widget .note-new-tab:active:before,
.tab-row-widget .note-new-tab:active:after {
    transform: scale(0.85);
    transition: transform 75ms ease-out;
}

.tab-row-filler {
    top: 0;
}

/*
 * CLASSIC FORMATTING TOOLBAR
 */

#rest-pane > .classic-toolbar-widget {
    margin-bottom: 2px;
}

body.layout-vertical #rest-pane > .classic-toolbar-widget {
    border-start-start-radius: var(--note-split-top-border-radius);
}

body.layout-vertical #rest-pane > .classic-toolbar-widget {
    background: var(--classic-toolbar-vert-layout-background-color);
}

body.layout-horizontal #rest-pane > .classic-toolbar-widget {
    background: var(--classic-toolbar-horiz-layout-background-color);
}

/*
 * CENTER PANE
 */

 /* Note split */
 body.desktop .vertical-layout #center-pane .note-split {
    border-bottom: 1px solid var(--status-bar-border-color);
 }

 /* The first visible note split */
.vertical-layout #center-pane .note-split:not(.visible ~ .visible) {
    border-start-start-radius: var(--note-split-top-border-radius);
}

body.desktop .vertical-layout #center-pane .note-split:not(.visible ~ .visible) {
    border-end-start-radius: var(--note-split-bottom-border-radius);
}

/* Use clip-path to force rounded bottom corner for the note content */
body.desktop .vertical-layout #center-pane
    .note-split:not(.visible ~ .visible) > .scrolling-container {
    clip-path: inset(0px round 0 0 0 var(--note-split-bottom-border-radius));
}

.vertical-layout .classic-toolbar-widget:not(.hidden-ext) + #vertical-main-container
    #center-pane .note-split:not(.visible ~ .visible) {
    border-start-start-radius: 0;
}

body.desktop.status-bar-panel-open .vertical-layout #center-pane
    .note-split:not(.visible ~ .visible) {
    border-end-start-radius: 0;
}

body.desktop.status-bar-panel-open .vertical-layout #center-pane
    .note-split:not(.visible ~ .visible) > .scrolling-container {
    clip-path: inset(0);
}

#center-pane .note-split {
    padding-top: 2px;
    background-color: var(--note-split-background-color, var(--main-background-color));
}

/* Mobile has no #center-pane: its splits stack inside #detail-container instead. */
:is(#center-pane, body.mobile #detail-container) .note-split {
    position: relative;

    &::after {
        content: "";
        position: absolute;
        inset: 0;
        border: 2px solid transparent;
        border-radius: inherit;
        pointer-events: none;
        transition: border-color 150ms ease-out;
        /* Above CodeMirror's gutters and panels (up to 300), below dropdowns (1000). */
        z-index: 500;
    }
}

/* The active split in a multi-split view */
#center-pane > .split-note-container-widget.multiple-splits > .note-split.active::after,
body.mobile #detail-container > .split-note-container-widget.multiple-splits
    > .note-split.active::after {
    border-color: var(--link-selection-outline-color);
}


body:not(.background-effects) #center-pane .note-split {
    animation: note-entrance 100ms linear;
}

@keyframes note-entrance {
    from {
        filter: opacity(0);
    } to {
        filter: opacity(1);
    }
}

/*
 * Note title
 */

.note-title.protected {
    text-shadow: unset !important;
}

body.mobile .note-title {
    background: transparent;
}

.title-row > *:first-child {
    margin-inline-end: 0;
}

.title-row > .component:nth-child(2) {
    margin-inline-start: 0;
}

body.desktop .title-row {
    /* Aligns the "Create new split" button with the note menu button (the three dots button) */
    padding-inline-end: 3px;
}

.note-title-widget input {
    --input-background-color: transparent;

    border-radius: 8px;
    padding-inline-start: 12px;
}

/* The "Change note icon" button */

:root .note-icon-widget button.note-icon {
    border: none;
}

.note-actions {
    --menu-item-icon-vert-offset: -2.5px;
}

/*
 * Note icon popup
 */

.note-icon-widget .icon-list span {
    border-radius: 6px;
}

.note-icon-widget .icon-list span:hover {
    background: var(--hover-item-background-color);
    color: var(--hover-item-text-color);
}

/*
 * Alert bar
 */

@keyframes alert-show {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#center-pane .note-split > div.alert {
    position: relative;
    margin: 0;
    border: unset;
    border-radius: 0;
    padding: 8px 16px;
    background: var(--alert-bar-background) !important;
    font-size: 0.9em;
    font-weight: normal;
    animation: alert-show 300ms ease-in;
    border-bottom: 2px solid #0000001c !important;
}

/*
 * Promoted attributes
 */

.promoted-attribute-cell div.input-group {
    margin: 1px 0;
}

/* The promoted attributes section */
div.promoted-attributes-container {
    margin-inline-end: 10%;
    padding: 6px 0;
    gap: 8px;
    align-items: stretch;
    container-type: inline-size;
}

div.promoted-attributes-container,
div.promoted-attributes-container input {
    font-size: 0.9rem;
}

/* A promoted attribute card */
div.promoted-attribute-cell {
    --pa-card-padding-inline-start: 16px;
    --pa-card-padding-inline-end: 2px;
    --input-background-color: transparent;

    box-shadow: var(--promoted-attribute-card-shadow);
    display: inline-flex;
    margin: 0;
    border-radius: 8px;
    padding: 2px var(--pa-card-padding-inline-end) 2px var(--pa-card-padding-inline-start);
    background: var(--promoted-attribute-card-background-color);
    overflow-y: visible;
}

@container (max-width: 500px) {
    /* Narrow promoted attributes section */
    div.promoted-attribute-cell {
        flex-grow: 1;
    }
}

/* A promoted attribute card (boolean attribute) */
div.promoted-attribute-cell:has(input[type="checkbox"]) {
    padding-inline-end: var(--pa-card-padding-inline-start);
}

div.promoted-attribute-cell > * {
    display: inline-block;
}

div.promoted-attribute-cell > label {
    font-weight: normal;
    white-space: nowrap;
    opacity: 0.75;
}

div.promoted-attribute-cell:not(:has(input[type="checkbox"])) > label::after {
    content: ":";
}

div.promoted-attribute-cell div.input-group {
    min-height: auto;
    padding: 1px 6px;
}

/*
 * The field of a label holding several values, which in this theme sits inside a card of its own. The
 * card is the frame — as it already is for the group around a single value's box, whose input gives up
 * its border and background here — so the field brings none, a second rounded edge just within the
 * first reading as two boxes where there is one.
 *
 * The border is kept and made invisible rather than dropped, so the chips sit where they would in a
 * theme that does frame the field.
 */
div.promoted-attribute-cell div.promoted-attribute-values {
    min-height: auto;

    > .tn-field {
        border-color: transparent;
    }
}

div.promoted-attribute-cell input {
    padding: 2px 8px;
    font-weight: 500;
}

div.promoted-attribute-cell input[type="text"] {
    width: 10em !important;
}

div.promoted-attribute-cell input[type="number"] {
    width: 6em !important;
}

div.promoted-attribute-cell span.open-external-link-button {
    display: flex;
    padding: 0;
    font-size: 1.2em;
}

div.promoted-attribute-cell .tn-checkbox {
    --box-label-gap: 0px;

    height: 1em;
    vertical-align: calc((1cap - 1em) / 2);
}

div.promoted-attribute-cell .tn-checkbox > input[type="checkbox"] {
    width: var(--box-size) !important;
}

div.promoted-attribute-cell.promoted-attribute-label-boolean > div:first-of-type {
    margin-inline-end: 0.5em;
}

/*
 * Find and replace bar
 */

 .find-replace-widget {
    container-type: inline-size;
    border-top: 3px solid var(--root-background) !important;
}

.find-replace-widget > div {
    padding: 8px;
}

.find-replace-widget > .replace-widget-box {
    padding-top: 0;
}

div.find-replace-widget div.find-widget-found-wrapper > span {
    min-width: 50px;
    font-style: normal;
    font-weight: normal;
}

/* The up / down buttons of the "Find in text" input */
.find-replace-widget .input-group button {
    font-size: 1.3em;
}

.find-replace-widget .form-check {
    padding-inline-start: 0;
    white-space: nowrap;
}

.find-replace-widget .form-check .form-check-input {
    margin-inline-start: 0;
}

/* Narrow version */
@container (max-width: 600px) {
    .find-replace-widget > *,
    .find-replace-widget input,
    .find-replace-widget button.btn.btn-sm {
        font-size: .9em;
    }

    .find-widget-box {
        position: relative;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .find-widget-box,
    .replace-widget-box {
        padding-inline-end: 3em !important;
    }

    .find-widget-close-button {
        position: absolute;
        top: .85em;
        inset-inline-end: .5em;
    }

    .find-widget-box > * {
        margin: unset !important;
    }

    div.find-widget-search-term-input-group {
        margin-bottom: 8px;
        max-width: unset;
        width: 100%;
    }

    .find-widget-found-wrapper,
    .find-widget-found-wrapper > span {
        min-width: 0 !important;
    }

    .find-widget-spacer {
        display: none;
    }

    .form-check {
        min-height: unset;
        margin-bottom: unset;
    }

    .replace-widget-box {
        gap: 8px;
    }

    .replace-widget-box > * {
        margin-inline-end: unset !important;
    }

    div.replace-widget-box button.btn.btn-sm {
        min-width: unset;
        white-space: nowrap;
    }
}

/*
 * RIGHT PANE: TABLE OF CONTENTS AND HIGHLIGHT LIST
 */

#right-pane {
    background: var(--right-pane-background-color);
}

/* Status bar delimiter */
body.desktop .vertical-layout #right-pane {
    border-bottom: 1px solid var(--status-bar-border-color);
 }

#right-pane > * {
    animation: fade-in 200ms ease-in;
}

#right-pane div.card-header {
    align-items: center;
    border: 0;
}

#right-pane .card-header-title {
    margin-top: 2px;
    font-weight: 600;
    font-size: .85em;
    letter-spacing: .3pt;
    color: var(--right-pane-heading-color);
}

#right-pane .card-header-buttons {
    align-items: center;
    top: 0;
}

#right-pane .toc li,
#right-pane .highlights-list li {
    padding-top: 2px;
    padding-inline-end: 8px;
    padding-bottom: 2px;
    border-radius: 4px;
    text-align: unset;
    transition:
        background-color 150ms ease-in,
        color 150ms ease-in;
}

#right-pane .highlights-list li {
    line-height: 1.2;
    padding: 8px;
}

#right-pane .toc li::marker,
#right-pane .highlights-list li::marker {
    color: var(--muted-text-color);
}

#right-pane .toc li:hover,
#right-pane .highlights-list li:hover {
    background: var(--right-pane-item-hover-background);
    color: var(--right-pane-item-hover-color);
    font-weight: normal;
    transition: background-color 300ms ease-out color 300ms ease-out;
}

#right-pane .toc li:active,
#right-pane .highlights-list li:active {
    background: transparent;
    transition: none;
}

/** Canvas **/

.excalidraw {
    --border-radius-lg: 6px;
}

.excalidraw .Island.App-toolbar {
    --island-bg-color: var(--floating-button-background-color);
    --shadow-island: 1px 1px 1px var(--floating-button-shadow-color);
}

.excalidraw .dropdown-menu {
    border: unset !important;
    box-shadow: unset !important;
    background-color: transparent !important;
    --island-bg-color: var(--menu-background-color);
    --shadow-island: 0px 10px 20px rgba(0, 0, 0, var(--dropdown-shadow-opacity));
    --default-border-color: var(--bs-dropdown-divider-bg);
    --button-hover-bg: var(--hover-item-background-color);
}

.excalidraw .dropdown-menu .dropdown-menu-container {
    border-radius: var(--dropdown-border-radius);
}

.excalidraw .dropdown-menu .dropdown-menu-container > div:not([class]):not(:last-child) {
    margin-inline-start: calc(var(--padding) * var(--space-factor) * -1) !important;
    margin-inline-end: calc(var(--padding) * var(--space-factor) * -1) !important;
}

.excalidraw .dropdown-menu:before {
    content: unset !important;
}