/* Search and on-demand context inside the management views. */
.report-discovery {
  position: sticky;
  top: 0;
  z-index: 26;
  padding-block: 8px;
  background: var(--panel-bg, #f4f7fb);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin-block: 0 14px;
}
.report-search {
  position: relative;
  min-width: 0;
  margin-block-end: 14px;
}
.report-discovery .report-search { margin: 0; }
.report-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-inline: 11px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--panel-muted);
  background: white;
}
.report-search-field:focus-within { border-color: #007eaf; outline: 1px solid #007eaf; }
.manager-shell .report-search-field svg { width: 17px; height: 17px; }
.manager-shell .report-search input {
  width: 100%;
  min-width: 0;
  padding: 7px 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  color: var(--identity-ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
}
.report-search-results {
  position: absolute;
  z-index: 28;
  inset: calc(100% + 5px) 0 auto;
  max-height: min(360px, 55dvh);
  overflow: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: white;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  box-shadow: 0 7px 20px #17253d1a;
  overscroll-behavior: contain;
}
.report-search-results li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-height: 40px;
  padding: 8px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}
.report-search-results small { color: var(--panel-muted); font-size: 11px; text-align: end; }
.report-search-results li:hover, .report-search-results li[aria-selected=true] { background: var(--identity-pale); }
.report-search-results .report-search-empty { color: var(--panel-muted); cursor: default; }
.report-search-hit { outline: 2px solid #0095da; outline-offset: 3px; scroll-margin-top: calc(var(--report-sticky-height, 0px) + 16px); }
main:has(.report-layout-editing) .report-search-hit { scroll-margin-top: calc(var(--report-sticky-height, 104px) + 16px); }
.report-help-heading {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.report-help-heading > :is(h2,h3) { min-width: 0; }
.report-help-heading > h2:first-child { margin-block: 8px; }
.report-context-note {
  flex: none;
  margin-inline-start: auto;
}
.manager-shell .report-help-trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #627789;
  cursor: pointer;
}
.manager-shell .report-help-trigger:hover,
.manager-shell .report-help-trigger:focus-visible { color: var(--identity-action); }
.manager-shell .report-help-trigger svg { width: 16px; height: 16px; }
.experience-brand .manager-shell .card-heading:has(> .report-context-note) {
  flex-wrap: nowrap;
  align-items: flex-start;
}
.experience-brand .manager-shell .card-heading:has(> .report-context-note) > div:first-child {
  flex: 1;
}
.experience-brand .manager-shell .rg-chart-title:has(> .report-context-note) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
}
@media (max-width: 560px) {
  .experience-brand .manager-shell .rg-chart-title:has(> .report-context-note) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .rg-chart-title > .report-context-note { grid-column: 2; grid-row: 1; }
  .rg-chart-title:has(> .report-context-note) > [data-save-route] {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
.report-help-popup {
  position: fixed; inset: auto; margin: 0; padding: 12px 14px; box-sizing: border-box;
  overflow: auto; overscroll-behavior: contain; border: 1px solid var(--panel-border);
  border-radius: 10px; background: white; color: var(--panel-ink);
  box-shadow: 0 6px 20px #17253d22; font-size: 12px; line-height: 1.9;
  overflow-wrap: anywhere;
}
.report-help-popup p { margin: 6px 0 0; }
@media(max-width: 540px) {
  .report-discovery { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .report-search-field { gap: 5px; padding-inline: 7px; }
  .manager-shell .report-search input { font-size: 12px; }
}
@media print {
  .report-search { display: none !important; }
  .report-discovery { display: none; }
  .report-search-hit { outline: none; }
  .report-help-trigger { display: none !important; }
  .report-help-heading,
  .experience-brand .manager-shell :is(.card-heading,.rg-chart-title):has(> .report-context-note) { display: block; }
  .report-help-popup { display: block; position: static; width: auto !important; max-height: none !important; box-shadow: none; }
}

#report-filter-panel { max-height: min(45dvh, 360px); overflow-y: auto; overscroll-behavior: contain; }
