/*
 * FABBRAIN: the screens the prototype does not draw, in its language (phase 2, Task 5).
 *
 * Loaded last on every page (css_assets.php) and at the end of index.php's
 * "fabbrain" bundle (index_css.php). The prototype shows a note, a canvas, the
 * tree and a few popovers; everything else (settings, the admin pages, trash,
 * search, tags, favourites, shares, attachments, the graph, the dashboard, the
 * diary, the tasks page, every dialog, menu and toast, the login page) takes
 * the same surfaces, type scale, spacing scale and radii: quiet icon buttons,
 * one primary button, hairline separators, no boxes around boxes.
 *
 * This file holds the components every screen shares; fabbrain-ui-paginas.css
 * the pages themselves (split by area to keep each file readable):
 *
 *   1. what this layer adds to the bridge of fabbrain-base.css
 *   2. buttons            3. fields          4. dialogs
 *   5. menus, toasts, tooltips
 *
 * Values are tokens only (fabbrain-tokens.css). Selectors start with
 * :root:not(#fabbrain-resto) and list their targets in :where(), so every rule
 * weighs (1,1,0) plus its pseudo-classes: like the bridge, an id inside :not()
 * outranks the upstream light and dark chains (html[data-theme='dark'] .x .y)
 * without !important, and within this file the later rule wins; the region files of Tasks 2-4 (html:root #right_col ...,
 * html:root #left_col ...) still outrank this one where they meet. !important
 * only against an upstream !important.
 */

/* ---- 1. The bridge, completed -------------------------------------------- */

/* The sentinel the e2e tests read: this layer is loaded */
:root {
    --fabbrain-ui-resto: 1;
}

/* The prototype has no green and no grey button: a success is the accent, a
   neutral fill is the quiet fill, a search hit is the selection tint (amber is
   reserved for "Não confirmado") */
html:not(#fabbrain-tema) {
    --pz-success: var(--fb-accent);
    --pz-success-hover: var(--fb-accent-text);
    --pz-success-soft: var(--fb-accent-soft);
    --pz-success-strong: var(--fb-accent-text);
    --pz-success-text: var(--fb-accent-text);
    --pz-success-text-hover: var(--fb-accent);
    --pz-neutral: var(--fb-fill);
    --pz-neutral-hover: var(--fb-active);
    --pz-danger-hover: var(--fb-danger);
    --pz-danger-soft: var(--fb-danger-soft);
    --pz-danger-strong: var(--fb-danger);
    --pz-danger-text-hover: var(--fb-danger);
    --pz-mark: var(--fb-selection);
    --pz-mark-active: var(--fb-hit-active);
    --pz-mark-active-text: var(--fb-text);
    --pz-radius-pill: var(--fb-radius-sm);
}

/* Pages with a font of their own (Inter by name, the system stack) */
:root:not(#fabbrain-resto) body {
    font-family: var(--fb-font-sans);
    color: var(--fb-text);
    background-color: var(--fb-bg);
}

/* ---- 2. Buttons: the prototype's .btn, one primary ----------------------- */

:root:not(#fabbrain-resto) :where(.btn, .modal-buttons button, .alert-modal-button, .login-button, .pz-btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--fb-space-3);
    min-height: var(--fb-btn-height);
    padding: 0 var(--fb-space-gap-mi);
    border: 0;
    border-radius: var(--fb-radius-row);
    background: var(--fb-fill);
    box-shadow: none;
    color: var(--fb-text);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-ui);
    font-weight: var(--fb-weight-medium);
    line-height: var(--fb-leading-base);
    white-space: nowrap;
    opacity: 1;
    transition: background-color var(--fb-dur-fast) var(--fb-ease), color var(--fb-dur-fast) var(--fb-ease);
}

:root:not(#fabbrain-resto) :where(.btn, .modal-buttons button, .alert-modal-button, .pz-btn):hover {
    background: var(--fb-active);
    color: var(--fb-text);
    opacity: 1;
}

/* The one primary: the accent with its label colour */
:root:not(#fabbrain-resto) :where(.btn-primary, .btn-success, .modal-buttons button.btn-primary, .modal-buttons button.btn-success,
    .alert-modal-button.primary, .alert-modal-button.btn-primary, .login-button, .btn-create-share, .modal-buttons button[type="submit"]) {
    background: var(--fb-accent);
    color: var(--fb-on-accent);
}

:root:not(#fabbrain-resto) :where(.btn-primary, .btn-success, .modal-buttons button.btn-primary, .modal-buttons button.btn-success,
    .alert-modal-button.primary, .alert-modal-button.btn-primary, .login-button, .btn-create-share, .modal-buttons button[type="submit"]):hover {
    background: var(--fb-accent);
    color: var(--fb-on-accent);
    filter: brightness(1.06);
}

/* A destructive action: the prototype's .mi.danger, red text on the quiet
   fill (the accent stays the one filled button) */
:root:not(#fabbrain-resto) :where(.btn-danger, .modal-buttons button.btn-danger, .alert-modal-button.danger, .alert-modal-button.btn-danger) {
    background: var(--fb-fill);
    color: var(--fb-danger);
}

:root:not(#fabbrain-resto) :where(.btn-danger, .modal-buttons button.btn-danger, .alert-modal-button.danger, .alert-modal-button.btn-danger):hover {
    background: var(--pz-danger-soft);
    color: var(--fb-danger);
}

/* Secondary and cancel: the quiet fill (no grey block, no outline) */
:root:not(#fabbrain-resto) :where(.btn-secondary, .btn-cancel, .modal-buttons button.btn-secondary, .modal-buttons button.btn-cancel, .btn-outline) {
    border: 0;
    background: var(--fb-fill);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) :where(.btn, .modal-buttons button, .alert-modal-button, .login-button):disabled,
:root:not(#fabbrain-resto) .btn.disabled {
    background: var(--fb-fill);
    color: var(--fb-faint);
    filter: none;
    cursor: not-allowed;
}

/* A button's icon takes its label's colour, at the prototype's icon size */
:root:not(#fabbrain-resto) :where(.btn, .modal-buttons button, .alert-modal-button) :where(i, .lucide) {
    color: inherit;
    font-size: var(--fb-icon-sm);
}

/* Focus: the accent ring of fabbrain-base.css, never removed by a page */
:root:not(#fabbrain-resto) :where(.btn, .modal-buttons button, .alert-modal-button, .login-button, .pz-toolbar-btn, .pz-btn):focus-visible {
    outline: var(--fb-focus-ring) solid var(--fb-accent);
    outline-offset: var(--fb-space-1);
}

/* The quiet button (fix wave): a secondary action beside a filled primary,
   drawn the same wherever it appears: "Confirmar" on a canvas strip that has
   "Enviar para a memória" as its primary, the strip's other actions, and the
   "Confirmar" of one task. A hairline ring on the page ground, the muted
   label, the hover fill. Two ids inside :not() (2,1,0): a region's own button
   rules (the canvas strip's .btn, a task row's) never reshape it. */
:root:not(#fabbrain-resto):not(#fabbrain-quieto) .fabbrain-botao-quieto {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: var(--fb-space-3);
    width: auto;
    height: var(--fb-btn-height);
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0 var(--fb-space-gap-mi);
    border: 0;
    border-radius: var(--fb-radius-row);
    background: transparent;
    box-shadow: var(--fb-field-ring);
    color: var(--fb-text-2);
    --note-font-size: var(--fb-text-ui);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-ui);
    font-weight: var(--fb-weight-medium);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    filter: none;
}

:root:not(#fabbrain-resto):not(#fabbrain-quieto) .fabbrain-botao-quieto::before {
    content: none;
}

:root:not(#fabbrain-resto):not(#fabbrain-quieto) .fabbrain-botao-quieto:hover {
    background: var(--fb-hover);
    color: var(--fb-text);
    filter: none;
}

:root:not(#fabbrain-resto):not(#fabbrain-quieto) .fabbrain-botao-quieto:focus-visible {
    outline: var(--fb-focus-ring) solid var(--fb-accent);
    outline-offset: var(--fb-space-1);
}

:root:not(#fabbrain-resto):not(#fabbrain-quieto) .fabbrain-botao-quieto:disabled {
    opacity: .6;
    cursor: default;
}

:root:not(#fabbrain-resto):not(#fabbrain-quieto) .fabbrain-botao-quieto[hidden] {
    display: none;
}

/* ---- 3. Fields ------------------------------------------------------------ */

/* A field of a dialog or of a page: surface, a hairline ring, the accent ring
   when focused. The editor, the tree search and the note title keep their own
   (fabbrain-base.css, fabbrain-ui-shell.css, fabbrain-ui-nota.css). */
:root:not(#fabbrain-resto) :where(.modal-content, .alert-modal, .home-container, .settings-shell, .login-container, .trash-container,
    .shared-container, .favorites-container, .tags-container, .attachments-container, .revisions-container,
    .restore-import-container, .backup-export-container, .admin-container, .users-container, .notes-manager,
    .ui-custom-panel)
    :where(input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="number"],
        input[type="url"], input[type="date"], input[type="time"], input[type="datetime-local"], input:not([type]), select, textarea) {
    min-height: var(--fb-field-height);
    padding: var(--fb-space-3) var(--fb-space-5);
    border: 0;
    border-radius: var(--fb-radius);
    background: var(--fb-surface-field);
    box-shadow: var(--fb-field-ring);
    color: var(--fb-text);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-base);
    line-height: var(--fb-leading-base);
}

:root:not(#fabbrain-resto) :where(.modal-content, .alert-modal, .home-container, .settings-shell, .login-container, .trash-container,
    .shared-container, .favorites-container, .tags-container, .attachments-container, .revisions-container,
    .restore-import-container, .backup-export-container, .admin-container, .users-container, .notes-manager,
    .ui-custom-panel)
    :where(input, select, textarea):focus {
    outline: 0;
    box-shadow: var(--fb-field-ring), var(--fb-focus-shadow);
}

:root:not(#fabbrain-resto) :where(input, textarea)::placeholder {
    color: var(--fb-muted);
    opacity: 1;
}

/* Checkboxes and radios in the accent */
:root:not(#fabbrain-resto) :where(input[type="checkbox"], input[type="radio"]) {
    accent-color: var(--fb-accent);
}

/* The page search fields (trash, tags, folders, shares): the tree's search */
:root:not(#fabbrain-resto) :where(.home-search-input, .trash-search-input, .filter-input, .pz-search-input, .shared-search-input,
    .tags-search-input, .attachments-search-input, .ui-custom-filter-input) {
    min-height: var(--fb-search-height);
    border: 0;
    border-radius: var(--fb-radius);
    background: var(--fb-fill);
    box-shadow: none;
    color: var(--fb-text);
    font-size: var(--fb-text-row);
}

/* A search field with its glyph at the left (settings, the list pages): the
   text starts after the glyph (the field rule above resets upstream's padding) */
:root:not(#fabbrain-resto) :where(.home-search-wrapper) :where(.home-search-input) {
    padding-left: calc(var(--fb-space-6) + var(--fb-icon-sm) + var(--fb-space-4));
}

:root:not(#fabbrain-resto) :where(.home-search-wrapper) :where(.home-search-icon) {
    left: var(--fb-space-6);
    color: var(--fb-muted);
    font-size: var(--fb-icon-sm);
}

/* ---- 4. Dialogs ------------------------------------------------------------ */

:root:not(#fabbrain-resto) :where(.modal, .alert-modal-overlay, .spinner-overlay) {
    background-color: var(--fb-scrim);
}

:root:not(#fabbrain-resto) :where(.modal-content, .alert-modal) {
    padding: var(--fb-space-10) var(--fb-space-11);
    border: 0;
    border-radius: var(--fb-radius-lg);
    background: var(--fb-surface-raised);
    box-shadow: var(--fb-shadow);
    color: var(--fb-text-2);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-base);
    line-height: var(--fb-leading-base);
}

:root:not(#fabbrain-resto) :where(.modal-content, .alert-modal) :where(h2, h3, .modal-title, .alert-modal-title) {
    margin: 0 0 var(--fb-space-4);
    color: var(--fb-text);
    font-size: var(--fb-text-md);
    font-weight: var(--fb-weight-semibold);
    letter-spacing: var(--fb-tracking-tight);
    line-height: var(--fb-leading-heading);
    text-align: left;
}

:root:not(#fabbrain-resto) :where(.modal-content, .alert-modal) :where(p, .modal-message, .alert-modal-body, .modal-body) {
    color: var(--fb-text-2);
    font-size: var(--fb-text-base);
    line-height: var(--fb-leading-base);
    text-align: left;
}

:root:not(#fabbrain-resto) :where(.modal-content, .alert-modal) label {
    color: var(--fb-muted);
    font-size: var(--fb-text-ui);
    font-weight: var(--fb-weight-medium);
}

/* Buttons at the bottom right, the primary last (the order upstream writes) */
:root:not(#fabbrain-resto) :where(.modal-buttons, .modal-footer, .alert-modal-footer) {
    gap: var(--fb-space-4);
    justify-content: flex-end;
    margin-top: var(--fb-space-10);
    padding: 0;
    border: 0;
    background: transparent;
}

/* Upstream paints the first button of a row in the accent and the last one as
   a bordered surface, whatever their roles: here only the classes speak */
:root:not(#fabbrain-resto) :where(.modal-buttons button:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-create-share):not([type="submit"])) {
    border: 0;
    background: var(--fb-fill);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) :where(.modal-buttons button:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-create-share):not([type="submit"])):hover {
    background: var(--fb-active);
}

/* A dialog's close cross: a quiet icon button */
:root:not(#fabbrain-resto) :where(.modal .close, .modal-close, .close-modal, .modal .close-button, .alert-modal-close) {
    display: inline-grid;
    place-items: center;
    width: var(--fb-row-height);
    height: var(--fb-row-height);
    border: 0;
    border-radius: var(--fb-radius);
    background: transparent;
    color: var(--fb-faint);
    font-size: var(--fb-icon);
    opacity: 1;
}

:root:not(#fabbrain-resto) :where(.modal .close, .modal-close, .close-modal, .modal .close-button, .alert-modal-close):hover {
    background: var(--fb-hover);
    color: var(--fb-text);
}

/* Lists inside a dialog (move to folder, linked notes, task lists): rows */
:root:not(#fabbrain-resto) .modal-content :where(.folder-option, .move-task-item, .note-reference-item, .linked-note-item, .folder-list-item) {
    border: 0;
    border-radius: var(--fb-radius);
    background: transparent;
    color: var(--fb-text-2);
    font-size: var(--fb-text-row);
}

:root:not(#fabbrain-resto) .modal-content :where(.folder-option, .move-task-item, .note-reference-item, .linked-note-item, .folder-list-item):hover {
    background: var(--fb-hover);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) .modal-content :where(.folder-option, .move-task-item, .note-reference-item, .linked-note-item, .folder-list-item) :where(i, .lucide) {
    color: var(--fb-faint);
}

/* Boxes inside the dialog lose their frame: hairlines only */
:root:not(#fabbrain-resto) .modal-content :where(.folder-list, .folders-list, .move-folder-list, .note-reference-list, .move-task-list) {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Recent-folder chips: the prototype's .chip */
:root:not(#fabbrain-resto) .modal-content :where(.recent-folder-chip, .move-folder-recent-item, .folder-chip) {
    min-height: var(--fb-chip-height);
    padding: 0 var(--fb-space-5);
    border: 0;
    border-radius: var(--fb-radius-sm);
    background: var(--fb-fill);
    color: var(--fb-text-2);
    font-size: var(--fb-text-sm);
}

/* Alerts inside a page or a dialog: a tint, no frame */
:root:not(#fabbrain-resto) :where(.alert, .modal-info-note, .info-box, .warning-box, .admin-warning, .info, .config-hint, .settings-hint, .import-limits) {
    border: 0;
    border-left: 0;
    border-radius: var(--fb-radius-md);
    background: var(--fb-fill);
    box-shadow: none;
    color: var(--fb-text-2);
    font-size: var(--fb-text-ui);
    line-height: var(--fb-leading-base);
}

:root:not(#fabbrain-resto) :where(.alert-error, .alert-danger, .admin-warning, .error-box) {
    background: var(--pz-danger-soft);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) :where(.alert-warning, .warning-box) {
    background: var(--fb-warn-soft);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) :where(.alert, .admin-warning) code {
    padding: 0 var(--fb-space-2);
    border-radius: var(--fb-radius-xs);
    background: var(--fb-fill);
    color: var(--fb-text);
}

/* ---- 5. Menus, toasts, tooltips ------------------------------------------- */

/* Every popover menu: the prototype's .pop and .mi */
:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu,
    .poznote-page-title-workspace-menu, .speed-dial-submenu, .create-menu, .task-actions-menu, .task-priority-menu,
    .page-more-menu, .settings-dropdown, .system-menu, .md-table-context-menu, .table-context-menu) {
    padding: var(--fb-space-3);
    border: 0;
    border-radius: var(--fb-radius-lg);
    background: var(--fb-surface-raised);
    box-shadow: var(--fb-shadow);
    color: var(--fb-text);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-base);
}

:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu,
    .poznote-page-title-workspace-menu, .create-menu, .task-actions-menu, .task-priority-menu, .page-more-menu, .system-menu,
    .md-table-context-menu, .table-context-menu)
    :where(.dropdown-item, .context-menu-item, .menu-item, .row-actions-item, .poznote-page-title-workspace-item, .task-actions-item, button[role="menuitem"]) {
    gap: var(--fb-space-gap-mi);
    padding: var(--fb-space-gap-row) var(--fb-space-5);
    border: 0;
    border-radius: var(--fb-radius);
    background: transparent;
    color: var(--fb-text);
    font-size: var(--fb-text-base);
    line-height: var(--fb-leading-base);
}

:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu,
    .poznote-page-title-workspace-menu, .create-menu, .task-actions-menu, .task-priority-menu, .page-more-menu, .system-menu,
    .md-table-context-menu, .table-context-menu)
    :where(.dropdown-item, .context-menu-item, .menu-item, .row-actions-item, .poznote-page-title-workspace-item, .task-actions-item, button[role="menuitem"]):where(:hover, :focus-visible) {
    background: var(--fb-hover);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu,
    .poznote-page-title-workspace-menu, .create-menu, .task-actions-menu, .task-priority-menu, .page-more-menu, .system-menu)
    :where(.dropdown-item, .context-menu-item, .menu-item, .row-actions-item, .task-actions-item, button[role="menuitem"]) :where(i, .lucide) {
    color: var(--fb-muted);
    font-size: var(--fb-icon-sm);
}

:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu, .task-actions-menu, .page-more-menu)
    :where(.danger, .dropdown-item-danger, .is-danger, [data-danger], .delete-item) {
    color: var(--fb-danger);
}

:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu, .task-actions-menu, .page-more-menu)
    :where(.danger, .dropdown-item-danger, .is-danger, [data-danger], .delete-item) :where(i, .lucide) {
    color: var(--fb-danger);
}

:root:not(#fabbrain-resto) :where(.dropdown-menu, .context-menu, .row-actions-menu, .folder-actions-menu, .note-actions-menu, .page-more-menu)
    :where(hr, .dropdown-divider, .menu-divider, .context-menu-separator) {
    height: var(--fb-hairline);
    margin: var(--fb-space-2) var(--fb-space-3);
    border: 0;
    background: var(--fb-line);
}

/* The tree's item menu: a state is not a link (upstream paints the offline
   toggle in the accent) */
:root:not(#fabbrain-resto) #left_col :where(.note-actions-menu, .dropdown-menu) :where(.dropdown-item, .menu-item) {
    color: var(--fb-text);
}

/* The slash menu and its submenus */
:root:not(#fabbrain-resto) :where(.slash-command-menu, .slash-command-submenu, .emoji-autocomplete, .note-link-autocomplete) {
    padding: var(--fb-space-3);
    border: 0;
    border-radius: var(--fb-radius-lg);
    background: var(--fb-surface-raised);
    box-shadow: var(--fb-shadow);
    font-family: var(--fb-font-sans);
}

:root:not(#fabbrain-resto) :where(.slash-command-menu, .slash-command-submenu) :where(.slash-command-item, .slash-submenu-item) {
    gap: var(--fb-space-gap-mi);
    padding: var(--fb-space-3) var(--fb-space-5);
    border-radius: var(--fb-radius);
    color: var(--fb-text);
    font-size: var(--fb-text-base);
}

:root:not(#fabbrain-resto) :where(.slash-command-menu, .slash-command-submenu) :where(.slash-command-item, .slash-submenu-item):where(:hover, .selected, .active, [aria-selected="true"]) {
    background: var(--fb-hover);
    color: var(--fb-text);
}

:root:not(#fabbrain-resto) :where(.slash-command-menu, .slash-command-submenu) :where(.slash-command-item, .slash-submenu-item) :where(i, .lucide) {
    color: var(--fb-muted);
}

/* Toasts: a raised strip at the bottom, the prototype's popover surface */
:root:not(#fabbrain-resto) :where(.notification-popup, .poznote-toast, .toast, .save-toast, .note-width-toast, .temporary-notification) {
    max-width: var(--fb-toast-max);
    padding: var(--fb-space-5) var(--fb-space-7);
    border: 0;
    border-radius: var(--fb-radius-md);
    background: var(--fb-surface-raised);
    box-shadow: var(--fb-shadow);
    color: var(--fb-text);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-ui);
    font-weight: var(--fb-weight-medium);
}

:root:not(#fabbrain-resto) :where(.notification-popup, .poznote-toast, .toast) :where(i, .lucide) {
    color: var(--fb-accent);
}

:root:not(#fabbrain-resto) :where(.notification-popup.error, .poznote-toast.error, .toast.error, .notification-popup.notification-error) :where(i, .lucide) {
    color: var(--fb-danger);
}

/* The app's tooltips: the prototype's .tip (text on the inverse ground) */
:root:not(#fabbrain-resto) :where(.pz-tooltip, .tooltip),
:root:not(#fabbrain-resto) [data-tooltip]::after {
    border: 0;
    border-radius: var(--fb-radius-sm);
    background: var(--fb-text);
    box-shadow: none;
    color: var(--fb-bg);
    font-family: var(--fb-font-sans);
    font-size: var(--fb-text-xs);
    font-weight: var(--fb-weight-regular);
}

/* Search hits in a note: the selection tint, not upstream's orange */
:root:not(#fabbrain-resto) :where(mark, .search-highlight, .search-hit, .highlight-match) {
    border-radius: var(--fb-radius-mark);
    background: var(--fb-selection);
    color: inherit;
}

:root:not(#fabbrain-resto) :where(.search-highlight.active, .search-highlight.current, .current-match) {
    background: var(--fb-hit-active);
}

/* Date pickers and the reminder dialog: the accent for the chosen day */
:root:not(#fabbrain-resto) :where(.calendar-day.selected, .calendar-day.today.selected, .mini-calendar-day.selected, .date-picker-day.selected) {
    background: var(--fb-accent);
    color: var(--fb-on-accent);
}

:root:not(#fabbrain-resto) :where(.calendar-day.today, .mini-calendar-day.today) {
    color: var(--fb-accent-text);
    font-weight: var(--fb-weight-semibold);
}

/* A switch (toggle) in the accent */
:root:not(#fabbrain-resto) :where(.toggle-switch input:checked + .slider, .switch input:checked + .slider, .pz-switch input:checked + span) {
    background-color: var(--fb-accent);
}

/* FABBRAIN: "Anexado por IA", the label of an attachment an AI agent added (both attachment lists) */
:root:not(#fabbrain-resto) :where(.fabbrain-anexo-ia) {
    display: inline-block;
    margin-left: var(--fb-space-3);
    padding: 0 var(--fb-space-3);
    border-radius: var(--fb-radius-sm);
    background: var(--fb-accent-soft);
    color: var(--fb-accent-text);
    font-size: var(--fb-text-2xs);
    font-weight: var(--fb-weight-medium);
    line-height: var(--fb-space-9);
    vertical-align: middle;
}

/* ---- Motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    :root:not(#fabbrain-resto) :where(.btn, .modal-buttons button, .task-row-actions) {
        transition: none;
    }
}
