/* First item of the topbar end group (GLOBAL_SEARCH_BEFORE): the group and the bar take the free topbar width
   and nothing more (flex-basis 0, min-width 0), so the toggle, logo, notifications and user menu keep their size
   (the group's gap separates them); the "⋯" overflow takes the rest. Full topbar height: tabs sit on its edge. */
.fi-topbar-end:has(> .fi-quick-nav-ctn) { flex: 1 1 0%; min-width: 0; align-self: stretch; }
.fi-topbar-end > .fi-quick-nav-ctn { flex: 1 1 0%; min-width: 0; align-self: stretch; display: flex; align-items: center; margin-inline-start: 0.75rem; }
@media (min-width: 64rem) { .fi-topbar-end > .fi-quick-nav-ctn { margin-inline-start: 0; } }
/* Shared: the nav spans the remaining topbar width (measured); the track carries the style's look. */
.fi-quick-nav { display: block; flex: 1 1 0%; min-width: 0; }
.fi-quick-nav-hint { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--color-gray-500, #6b7280); }
.dark .fi-quick-nav-hint { color: var(--color-gray-400, #9ca3af); }

/* Every style: the track is only as wide as its pills and centered in the nav ("⋯" and "+" stay inside it, after the list). */
.fi-quick-nav-track { display: flex; align-items: center; gap: 0.5rem; min-width: 0; width: fit-content; max-width: 100%; margin-inline: auto; }
/* The list clips overflow: 3px padding keeps focus rings and shadows inside it, the negative margin keeps its layout width (and the overflow math) unchanged. */
.fi-quick-nav-list { display: flex; flex-wrap: nowrap; gap: 0.5rem; min-width: 0; overflow: hidden; margin: -3px; padding: 3px; list-style: none; }
.fi-quick-nav-pill { display: flex; flex-shrink: 0; align-items: center; border-radius: 9999px; border: 1px solid var(--color-gray-200, #e5e7eb); background: var(--color-white, #fff); color: var(--color-gray-700, #374151); font-size: 0.875rem; white-space: nowrap; }
/* Edit mode: the pill menu follows the link, so the link pads its start only. */
.fi-quick-nav-pill > a { display: flex; align-items: center; gap: 0.375rem; padding-block: 0.25rem; padding-inline: 0.625rem 0.25rem; color: inherit; }
.fi-quick-nav-pill.fi-icon-only > a { padding-inline: 0.375rem 0.125rem; }
/* Normal mode: the link is the whole pill (no menu), so it pads both sides itself. */
.fi-quick-nav-pill > a:only-child { padding-inline: 0.625rem; }
.fi-quick-nav-pill.fi-icon-only > a:only-child { padding-inline: 0.375rem; }
.fi-quick-nav-pill .fi-icon { width: 1rem; height: 1rem; }
/* Marquee (labels longer than QuickNavBar::MARQUEE_THRESHOLD): clipped at 15ch with an ellipsis; the full text stays in the DOM
   (screen readers) and in the pill's title. Only while the pill is hovered or focused it scrolls to its end and back; the
   inner span becomes inline-block for that (transforms skip inline boxes). Reduced motion keeps the ellipsis. Anchored on the
   link / folder trigger itself, so an open folder panel (inside the pill) does not keep it scrolling and only keyboard focus does. */
.fi-quick-nav-marquee { display: block; min-width: 0; max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
    :is(.fi-quick-nav-pill > a, .fi-quick-nav-folder-trigger):is(:hover, :focus-visible) .fi-quick-nav-marquee { text-overflow: clip; }
    :is(.fi-quick-nav-pill > a, .fi-quick-nav-folder-trigger):is(:hover, :focus-visible) .fi-quick-nav-marquee > span { display: inline-block; animation: lyrion-quick-nav-marquee calc(var(--lyrion-marquee-chars) * 0.25s) ease-in-out infinite alternate; }
}
/* 100% is the text's width: it moves by exactly the clipped part (never right, if the text happens to fit). */
@keyframes lyrion-quick-nav-marquee { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(min(0px, calc(15ch - 100%))); } }
.fi-quick-nav-pill.fi-active { border-color: var(--accent-600); background: var(--accent-600); color: #fff; }
.fi-quick-nav-pill.fi-active .fi-icon-btn { color: #fff; }
.dark .fi-quick-nav-pill { border-color: rgb(255 255 255 / 0.12); background: var(--color-gray-900, #111827); color: var(--color-gray-200, #e5e7eb); }
.dark .fi-quick-nav-pill.fi-active { border-color: var(--accent-500); background: var(--accent-500); color: #fff; }
/* Edit mode: the whole pill is the wire:sort source (look: lyrion-navigation::partials.edit-mode-styles); the pill menu trigger appears on hover/focus.
   Hidden with opacity, not display/visibility: the pill keeps its width (overflow measurement) and the trigger stays focusable. */
.fi-quick-nav-menu { opacity: 0; transition: opacity 120ms ease; }
.fi-quick-nav-pill:is(:hover, :focus-within) .fi-quick-nav-menu { opacity: 1; }
/* The teleported menu takes hover and focus out of the pill: keep the trigger visible while it is open (Filament sets aria-expanded). */
.fi-quick-nav-menu:has([aria-expanded="true"]) { opacity: 1; }
@media (hover: none), (any-pointer: coarse) { .fi-quick-nav-menu { opacity: 1; } }
/* The icon buttons use -0.5rem margins: padding keeps their hover area inside the track (36px wide in total). */
.fi-quick-nav-more { flex-shrink: 0; padding-inline: 0.5rem; }
.fi-quick-nav-overflow-item { display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.5rem; font-size: 0.875rem; }
.fi-quick-nav-overflow-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-quick-nav-overflow-item a.fi-active { color: var(--accent-600); font-weight: 600; }
.dark .fi-quick-nav-overflow-item a.fi-active { color: var(--accent-500); }

/* segment: pills in a tinted rail, the active one is a raised segment. */
.fi-quick-nav[data-style="segment"] .fi-quick-nav-track { gap: 0.375rem; padding: 0.3125rem; border-radius: 0.75rem; background: var(--color-gray-100, #f3f4f6); }
.fi-quick-nav[data-style="segment"] .fi-quick-nav-list { gap: 0.375rem; }
.fi-quick-nav[data-style="segment"] .fi-quick-nav-pill { border-color: transparent; border-radius: 0.5rem; background: transparent; color: var(--color-gray-600, #4b5563); }
.fi-quick-nav[data-style="segment"] .fi-quick-nav-pill.fi-active { background: var(--color-white, #fff); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 0 0 1px rgb(0 0 0 / 0.04); color: var(--color-gray-950, #030712); font-weight: 600; }
/* a > .fi-icon: only the item icon takes the accent, the menu trigger's icon stays neutral. */
.fi-quick-nav[data-style="segment"] .fi-quick-nav-pill.fi-active > a > .fi-icon { color: var(--accent-600); }
.fi-quick-nav[data-style="segment"] .fi-quick-nav-pill.fi-active .fi-icon-btn { color: var(--color-gray-500, #6b7280); }
.dark .fi-quick-nav[data-style="segment"] .fi-quick-nav-track { background: rgb(255 255 255 / 0.05); }
.dark .fi-quick-nav[data-style="segment"] .fi-quick-nav-pill { color: var(--color-gray-400, #9ca3af); }
.dark .fi-quick-nav[data-style="segment"] .fi-quick-nav-pill.fi-active { background: var(--color-gray-800, #1f2937); box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.06); color: #fff; }
.dark .fi-quick-nav[data-style="segment"] .fi-quick-nav-pill.fi-active > a > .fi-icon { color: var(--accent-500); }
.dark .fi-quick-nav[data-style="segment"] .fi-quick-nav-pill.fi-active .fi-icon-btn { color: var(--color-gray-400, #9ca3af); }

/* tabs: text only, the tabs fill the topbar height so the accent underline of the active tab sits on the
   topbar's bottom edge (its ring is the hairline; inset shadows: the list clips overflow). */
.fi-quick-nav[data-style="tabs"] { align-self: stretch; display: flex; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-track { flex: 0 1 auto; gap: 1.25rem; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-list { align-self: stretch; gap: 1.25rem; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill { border: 0; border-radius: 0; background: transparent; color: var(--color-gray-500, #6b7280); }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill > a { align-self: stretch; padding-block: 0.375rem; padding-inline: 0 0.25rem; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill > a:only-child { padding-inline: 0; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill > a > .fi-icon { display: none; }
/* Compact: an icon-only tab has no text, so it shows its icon. */
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill.fi-icon-only > a > .fi-icon { display: block; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill:hover { color: var(--color-gray-900, #111827); }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill.fi-active { box-shadow: inset 0 -2px 0 var(--accent-600); color: var(--color-gray-950, #030712); font-weight: 600; }
.fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill.fi-active .fi-icon-btn { color: var(--color-gray-500, #6b7280); }
.dark .fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill { background: transparent; color: var(--color-gray-400, #9ca3af); }
.dark .fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill:hover { color: var(--color-gray-100, #f3f4f6); }
.dark .fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill.fi-active { box-shadow: inset 0 -2px 0 var(--accent-500); color: #fff; }
.dark .fi-quick-nav[data-style="tabs"] .fi-quick-nav-pill.fi-active .fi-icon-btn { color: var(--color-gray-400, #9ca3af); }

/* capsule: one floating capsule (a short shadow: a long one would spill below the topbar). */
.fi-quick-nav[data-style="capsule"] .fi-quick-nav-track { gap: 0.25rem; padding: 0.25rem; border: 1px solid var(--color-gray-200, #e5e7eb); border-radius: 9999px; background: var(--color-white, #fff); box-shadow: 0 2px 6px rgb(0 0 0 / 0.08); }
.fi-quick-nav[data-style="capsule"] .fi-quick-nav-list { gap: 0.25rem; }
.fi-quick-nav[data-style="capsule"] .fi-quick-nav-pill:not(.fi-active) { border-color: transparent; background: transparent; }
.dark .fi-quick-nav[data-style="capsule"] .fi-quick-nav-track { border-color: rgb(255 255 255 / 0.1); background: var(--color-gray-900, #111827); box-shadow: 0 2px 6px rgb(0 0 0 / 0.4); }
/* Folders: the trigger is the pill; the dropdown is not teleported (Livewire finds its wire:sort list inside the component).
   Filament's floating panel is position: absolute: it escapes the list's overflow clipping only while no element between
   the list and the topbar is positioned, so the folder pill stays static (edit mode makes sortables relative), except as
   the drop slot, whose label is positioned on it (its panel is closed while dragging). */
.fi-quick-nav-pill.fi-quick-nav-folder:not(.sortable-ghost) { position: static; }
.fi-quick-nav-folder-trigger { display: flex; align-items: center; gap: 0.375rem; padding-block: 0.25rem; padding-inline: 0.625rem 0.25rem; color: inherit; }
.fi-quick-nav-pill > .fi-dropdown:only-child .fi-quick-nav-folder-trigger { padding-inline: 0.625rem; }
.fi-quick-nav-folder-trigger .fi-quick-nav-chevron { width: 0.75rem; height: 0.75rem; opacity: 0.6; }
.fi-quick-nav-folder-list { display: flex; flex-direction: column; gap: 0.125rem; min-height: 2rem; margin: 0; padding: 0.25rem; list-style: none; }
.fi-quick-nav-folder-item { display: flex; align-items: center; gap: 0.25rem; border-radius: 0.375rem; padding-inline-end: 0.25rem; font-size: 0.875rem; }
.fi-quick-nav-folder-item a { display: flex; flex: 1; min-width: 0; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-quick-nav-folder-item a.fi-active { color: var(--accent-600); font-weight: 600; }
.fi-quick-nav-folder-item .fi-icon { width: 1rem; height: 1rem; }
.fi-quick-nav-folder-item:is(:hover, :focus-within) .fi-quick-nav-menu { opacity: 1; }
.fi-quick-nav-folder-empty { margin: 0; padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: var(--color-gray-500, #6b7280); }
.fi-quick-nav-overflow-folder { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; font-weight: 600; color: var(--color-gray-500, #6b7280); }
.fi-quick-nav-overflow-item.fi-quick-nav-overflow-child { padding-inline-start: 1.25rem; }
.fi-quick-nav-add { flex-shrink: 0; padding-inline: 0.5rem; }
/* The folder panel sits inside the pill: it must not inherit the pill's (active) text look. */
.fi-quick-nav .fi-quick-nav-pill.fi-quick-nav-folder .fi-dropdown-panel { color: var(--color-gray-950, #030712); font-weight: 400; white-space: normal; }
.fi-quick-nav .fi-quick-nav-pill.fi-quick-nav-folder .fi-dropdown-panel .fi-icon-btn { color: var(--color-gray-400, #9ca3af); }
.dark .fi-quick-nav .fi-quick-nav-pill.fi-quick-nav-folder .fi-dropdown-panel { color: var(--color-gray-200, #e5e7eb); }
.dark .fi-quick-nav-folder-item a.fi-active { color: var(--accent-500); }
.dark .fi-quick-nav-folder-empty, .dark .fi-quick-nav-overflow-folder { color: var(--color-gray-400, #9ca3af); }
