/* ═══════════════════════════════════════════════════════════════════════════
   SHELL — the application frame.

   Left rail + top bar + content region + command palette. Loaded after the
   legacy custom.css so the frame wins over old fixed-position navbar rules.

   The rail is present for signed-out visitors too, carrying the public
   marketplace sections. One navigation model for all 89 pages rather than
   horizontal dropdowns for guests and a hidden offcanvas for members.
   ═══════════════════════════════════════════════════════════════════════════ */


/* ═══ SHELL GRID ═══════════════════════════════════════════════════════════ */

body {
  /* The legacy rule set `display:flex; padding-top:70px` on body to clear the
     old fixed navbar. The shell owns that offset now. */
  display: block;
  padding-top: 0;
}

.app {
  --rail: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
}

html.rail-collapsed .app {
  --rail: var(--sidebar-w-collapsed);
}

/* Below the lg breakpoint the rail leaves the flow and becomes a drawer */
@media (max-width: 991.98px) {
  .app,
  html.rail-collapsed .app {
    --rail: 0px;
  }
}


/* ═══ LEFT RAIL ════════════════════════════════════════════════════════════ */

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  width: var(--rail);
  background: var(--surface-1);
  border-right: 1px solid var(--border-subtle);
  transition: width var(--dur-normal) var(--ease-out),
              transform var(--dur-normal) var(--ease-out);
  will-change: width;
}

/* Drawer behaviour on small screens */
@media (max-width: 991.98px) {
  .app-sidebar {
    width: min(300px, 86vw);
    transform: translateX(-100%);
    box-shadow: var(--shadow-2xl);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-sidebar) - 1);
    background: var(--surface-scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-normal) var(--ease-out);
    backdrop-filter: blur(2px);
  }

  body.sidebar-open .app-sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 992px) {
  .app-sidebar-scrim {
    display: none;
  }
}


/* ─── Rail brand ────────────────────────────────────────────────────────── */

.rail-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-h);
  padding: 0 var(--space-4);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.rail-brand__logo {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  background: none;
}

.rail-brand__mark {
  display: none;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  place-items: center;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-extra);
  color: var(--text-on-brand);
  background: linear-gradient(135deg, var(--bd-green-400), var(--bd-green-600));
  border-radius: var(--radius-md);
  box-shadow: var(--highlight-top-strong);
}

html.rail-collapsed .rail-brand {
  padding: 0;
  justify-content: center;
}

html.rail-collapsed .rail-brand__logo {
  display: none;
}

html.rail-collapsed .rail-brand__mark {
  display: grid;
}


/* ─── Rail scroll body ──────────────────────────────────────────────────── */

.rail-nav {
  flex: 1;
  min-height: 0;
  padding: var(--space-3) var(--space-2) var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The rail carries 30+ links for a signed-in breeder and genuinely overflows,
   so the scrollbar stays visible — just quiet. Hiding it until hover (the
   original approach here) hid the only cue that there is more nav below. */
.rail-nav {
  scrollbar-width: thin;
  scrollbar-color: var(--bd-neutral-700) transparent;
  transition: scrollbar-color var(--dur-normal) var(--ease-out);
}

.rail-nav::-webkit-scrollbar {
  width: 8px;
}

.rail-nav::-webkit-scrollbar-thumb {
  background: var(--bd-neutral-700);
  background-clip: padding-box;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
}

/* Brighten on hover so it reads as grabbable */
.app-sidebar:hover .rail-nav {
  scrollbar-color: var(--bd-neutral-600) transparent;
}

.app-sidebar:hover .rail-nav::-webkit-scrollbar-thumb {
  background: var(--bd-neutral-600);
  background-clip: padding-box;
}


/* ─── Section labels ────────────────────────────────────────────────────── */

.rail-section {
  padding: var(--space-4) var(--space-3) var(--space-2);
  font-size: var(--fs-3xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.rail-section:first-child {
  padding-top: var(--space-1);
}

.rail-section--admin {
  color: var(--bd-amber-500);
}

/* Collapsed: labels become a divider rule, since the text cannot fit */
html.rail-collapsed .rail-section {
  margin: var(--space-3) auto var(--space-2);
  padding: 0;
  width: 24px;
  height: 1px;
  overflow: hidden;
  color: transparent;
  background: var(--border-default);
}


/* ─── Rail links ────────────────────────────────────────────────────────── */

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin-bottom: 1px;
  font-size: var(--fs-ui);
  font-weight: var(--fw-medium);
  line-height: 1.35;
  color: var(--text-tertiary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
}

.rail-link > i,
.rail-link > .rail-link__icon {
  flex-shrink: 0;
  width: 18px;
  font-size: 1rem;
  text-align: center;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}

.rail-link__text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.rail-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.rail-link:hover > i,
.rail-link:hover > .rail-link__icon {
  color: var(--text-secondary);
}

.rail-link.active {
  color: var(--text-primary);
  background: var(--surface-selected);
}

.rail-link.active > i,
.rail-link.active > .rail-link__icon {
  color: var(--brand);
}

/* Active marker on the rail edge, not a full-width fill */
.rail-link.active::before {
  content: "";
  position: absolute;
  left: calc(var(--space-3) * -1 + 2px);
  top: 50%;
  width: 3px;
  height: 18px;
  background: var(--brand);
  border-radius: var(--radius-full);
  transform: translateY(-50%);
}

.rail-link--sub {
  padding-left: calc(var(--space-3) + var(--space-6));
  font-size: var(--fs-sm);
  font-weight: var(--fw-regular);
}

.rail-link--sub > i {
  width: 14px;
  font-size: 0.8rem;
}

.rail-link--admin > i,
.rail-link--admin.active > i {
  color: var(--bd-amber-500);
}

.rail-link--admin.active {
  background: var(--accent-subtle);
}

.rail-link--admin.active::before {
  background: var(--bd-amber-500);
}

/* Badge on the right of a rail link */
.rail-badge {
  flex-shrink: 0;
  min-width: 18px;
  padding: 0 5px;
  font-size: var(--fs-3xs);
  font-weight: var(--fw-bold);
  line-height: 18px;
  text-align: center;
  color: var(--bd-white);
  background: var(--status-danger);
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
}


/* ─── Collapsed rail ─────────────────────────────────────────────────────── */

@media (min-width: 992px) {
  html.rail-collapsed .rail-link {
    justify-content: center;
    padding-inline: 0;
  }

  html.rail-collapsed .rail-link__text {
    display: none;
  }

  html.rail-collapsed .rail-link--sub {
    padding-left: 0;
  }

  html.rail-collapsed .rail-link.active::before {
    left: 2px;
  }

  /* Count-only badge pinned to the icon */
  html.rail-collapsed .rail-badge {
    position: absolute;
    top: 3px;
    right: 8px;
    min-width: 15px;
    padding: 0 3px;
    font-size: 9px;
    line-height: 15px;
    border: 2px solid var(--surface-1);
  }

  /* Label as a tooltip, since the text is hidden */
  html.rail-collapsed .rail-link[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + var(--space-3));
    top: 50%;
    z-index: var(--z-tooltip);
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--text-primary);
    white-space: nowrap;
    background: var(--bd-neutral-990);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(-50%);
    pointer-events: none;
  }
}


/* ─── Rail footer ───────────────────────────────────────────────────────── */

.rail-footer {
  flex-shrink: 0;
  padding: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.rail-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2);
  font-size: var(--fs-ui);
  color: var(--text-secondary);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
}

.rail-user:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.rail-user__avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  overflow: hidden;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  color: var(--text-on-brand);
  background: linear-gradient(135deg, var(--bd-green-400), var(--bd-green-600));
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.rail-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-user__meta {
  flex: 1;
  min-width: 0;
}

.rail-user__name {
  display: block;
  overflow: hidden;
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.rail-user__role {
  display: block;
  overflow: hidden;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.rail-collapsed .rail-user {
  justify-content: center;
  padding-inline: 0;
}

html.rail-collapsed .rail-user__meta,
html.rail-collapsed .rail-user__caret {
  display: none;
}

/* Account menu.
   Sized independently of the rail: at 264px it can match the trigger, but the
   collapsed rail is only 64px wide and a menu that inherited that width would
   be an unreadable sliver. min-width wins in both states. */
.rail-user-menu {
  min-width: 216px;
  margin-bottom: var(--space-2);
}

/* Unverified-email nudge */
.rail-alert {
  margin: 0 var(--space-2) var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
  color: var(--bd-amber-300);
  background: var(--status-warning-subtle);
  border: 1px solid rgba(248, 166, 47, 0.28);
  border-radius: var(--radius-md);
}

.rail-alert a {
  color: var(--bd-amber-400);
  font-weight: var(--fw-semibold);
  text-decoration: underline;
}

html.rail-collapsed .rail-alert {
  display: none;
}


/* ═══ TOP BAR ══════════════════════════════════════════════════════════════ */

.app-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--rail);
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-h);
  padding: 0 var(--gutter);
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: left var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

/* Lift the bar once content scrolls beneath it */
.app-topbar.is-scrolled {
  box-shadow: var(--shadow-md);
}

@supports not (backdrop-filter: blur(1px)) {
  .app-topbar {
    background: var(--surface-1);
  }
}

.topbar-icon-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 1.05rem;
  color: var(--text-tertiary);
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
}

.topbar-icon-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.topbar-icon-btn.has-dot {
  position: relative;
}

.topbar-icon-btn .topbar-dot {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 16px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: var(--fw-bold);
  line-height: 16px;
  color: var(--bd-white);
  background: var(--status-danger);
  border: 2px solid var(--surface-1);
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
}

/* Rail toggle is desktop-only; the drawer trigger takes over below lg */
.topbar-rail-toggle { display: none; }
.topbar-drawer-toggle { display: grid; }

@media (min-width: 992px) {
  .topbar-rail-toggle { display: grid; }
  .topbar-drawer-toggle { display: none; }
}


/* ─── Topbar title / breadcrumb ─────────────────────────────────────────── */

.topbar-heading {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.topbar-title {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.topbar-crumbs a {
  color: var(--text-muted);
}

.topbar-crumbs a:hover {
  color: var(--text-secondary);
}

.topbar-crumbs__sep {
  color: var(--text-muted);
  font-size: 0.7rem;
}

@media (max-width: 767.98px) {
  .topbar-crumbs { display: none; }
}


/* ─── Search trigger (opens the command palette) ────────────────────────── */

.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: clamp(180px, 26vw, 340px);
  padding: 0 var(--space-2) 0 var(--space-3);
  height: 34px;
  font-size: var(--fs-ui);
  color: var(--text-muted);
  text-align: left;
  background: var(--surface-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-colors);
}

.topbar-search:hover {
  color: var(--text-secondary);
  background: var(--surface-4);
  border-color: var(--border-default);
}

.topbar-search__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-search kbd {
  flex-shrink: 0;
}

@media (max-width: 767.98px) {
  .topbar-search {
    width: 34px;
    padding: 0;
    justify-content: center;
    background: none;
    border-color: transparent;
  }
  .topbar-search__label,
  .topbar-search kbd { display: none; }
}


/* ═══ MAIN REGION ══════════════════════════════════════════════════════════ */

.app-main {
  margin-left: var(--rail);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--dur-normal) var(--ease-out);
}

.app-content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gutter);
  /* Bootstrap `.row` with a gutter class applies negative side margins and
     expects a `.container` with matching padding to absorb them. Some sections
     put a `.row g-5` directly in here, whose -24px outran this padding and gave
     the document ~12px of horizontal scroll.
     `clip` rather than `hidden`: both stop the overflow, but `hidden` makes this
     a scroll container and would break `position: sticky` on .app-subbar and the
     data-table headers. */
  overflow-x: clip;
}

/* Full-bleed content (home hero, maps, checkout) opts out of the max-width */
.app-content--flush {
  max-width: none;
  padding: 0;
}

/* Long-form reading measure for legal/help pages */
.app-content--prose {
  max-width: calc(var(--prose-max) + var(--gutter) * 2);
}


/* ─── Page header ───────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.page-header--plain {
  padding-bottom: 0;
  border-bottom: 0;
}

.page-header__text {
  flex: 1 1 22rem;
  min-width: 0;
}

.page-header__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
}

.page-header__subtitle {
  margin: var(--space-2) 0 0;
  max-width: var(--prose-max);
  font-size: var(--fs-ui);
  color: var(--text-muted);
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* Bare shape, without the __text / __actions wrappers:
       <div class="page-header"><h1>Title</h1><div>…actions…</div></div>
   Used by the tool pages converted from the legacy
   `d-flex justify-content-between` + `<hN class="mb-0">` pattern. The heading
   grows so trailing siblings are pushed to the right, matching the
   space-between behaviour that markup had. */
.page-header > h1,
.page-header > h2,
.page-header > h3,
.page-header > h4 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text-primary);
}

.page-header > h1 ~ *,
.page-header > h2 ~ *,
.page-header > h3 ~ *,
.page-header > h4 ~ * {
  flex-shrink: 0;
}

/* Inline metric strip under a page title */
.page-header__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-3);
}

.page-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-stat__value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.page-stat__label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}


/* ─── Sub-bar: filters, tabs, view switches ─────────────────────────────── */

.app-subbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: var(--space-3) 0;
  background: linear-gradient(var(--surface-base) 70%, transparent);
}


/* ═══ COMMAND PALETTE ══════════════════════════════════════════════════════ */

.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-palette);
  display: grid;
  place-items: start center;
  padding: max(8vh, var(--space-12)) var(--space-4) var(--space-4);
  background: var(--surface-scrim);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity var(--dur-fast) var(--ease-out);
}

.cmdk-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cmdk {
  width: min(620px, 100%);
  max-height: min(60vh, 520px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl), var(--highlight-top-strong);
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition: transform var(--dur-normal) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}

.cmdk-backdrop.is-open .cmdk {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cmdk__search {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.cmdk__search > i {
  flex-shrink: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.cmdk__input {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-md);
  color: var(--text-primary);
  background: none;
  border: 0;
  outline: none;
}

.cmdk__input::placeholder {
  color: var(--text-muted);
}

.cmdk__spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand);
  border-radius: var(--radius-full);
  animation: cmdk-spin 0.6s linear infinite;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.cmdk.is-loading .cmdk__spinner {
  opacity: 1;
}

@keyframes cmdk-spin {
  to { transform: rotate(360deg); }
}

.cmdk__results {
  flex: 1;
  min-height: 0;
  padding: var(--space-2);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cmdk__group-label {
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-size: var(--fs-3xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--text-muted);
}

.cmdk__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-ui);
  color: var(--text-secondary);
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.cmdk__item > i,
.cmdk__item .cmdk__thumb {
  flex-shrink: 0;
  width: 20px;
  font-size: 0.95rem;
  text-align: center;
  color: var(--text-muted);
}

.cmdk__thumb {
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: var(--radius-xs);
}

.cmdk__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cmdk__item-body {
  flex: 1;
  min-width: 0;
}

.cmdk__item-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk__item-sub {
  display: block;
  overflow: hidden;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk__item mark {
  padding: 0;
  color: var(--brand);
  background: none;
  font-weight: var(--fw-semibold);
}

.cmdk__item-hint {
  flex-shrink: 0;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
}

/* Selection follows the keyboard, so it must not depend on :hover */
.cmdk__item.is-active,
.cmdk__item:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.cmdk__item.is-active {
  background: var(--surface-selected);
}

.cmdk__item.is-active > i {
  color: var(--brand);
}

.cmdk__empty {
  padding: var(--space-8) var(--space-4);
  font-size: var(--fs-ui);
  color: var(--text-muted);
  text-align: center;
}

.cmdk__footer {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

.cmdk__footer-hint {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

@media (max-width: 575.98px) {
  .cmdk__footer { display: none; }
}


/* ═══ FLOATING ACTION CLUSTER ══════════════════════════════════════════════
   The theme already ships help-bot, suggestion and bug-report buttons plus a
   cart. Left loose they collide; this stacks them into one predictable column
   anchored bottom-right. */

.app-fab-stack {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: var(--space-3);
  pointer-events: none;
}

.app-fab-stack > * {
  pointer-events: auto;
}

@media (max-width: 575.98px) {
  .app-fab-stack {
    right: var(--space-3);
    bottom: var(--space-3);
    gap: var(--space-2);
  }
}
