/**
 * Firm.CompanyName 3.0 — Factsheets page styles.
 *
 * Scoped under `.fe30-factsheets`. Reuses IAMS tokens from
 * `tokens-base.css`, the shell button system from `3.0-shell.css`, and the
 * shared `.fe30-chip` / `.fe30-popover` primitives from `fe30-components.css`.
 *
 * Layout (top → bottom):
 *   .fe30-factsheets-header        page title + subtitle
 *   .fe30-factsheets-hero          search input + quick-pick chips
 *   .fe30-factsheets-error         inline retry banner
 *   .fe30-factsheets-toolbar       sticky filter chip row + sort/view toggle
 *   .fe30-factsheets-active-chips  removable applied filters
 *   .fe30-factsheets-pinned-row    favorites strip (Phase 3)
 *   .fe30-factsheets-recents-row   recently used strip (Phase 3)
 *   .fe30-factsheets-grid          responsive card grid
 *   .fe30-factsheets-bulkbar       multi-select bottom bar (Phase 4)
 *   .fe30-factsheets-drawer        right-side preview drawer (Phase 2)
 *   .fe30-factsheets-toast         status messages
 *
 * Phases 2-5 introduce drawer / pinned / recents / bulkbar — those styles
 * are already declared so the controller can wire them in without a
 * second CSS pass.
 */

/* ============================================================
   PAGE CHROME
   ============================================================ */

.fe30-factsheets {
  /* Shell `.fe30-main` provides outer padding; we cap reading width on wide
     monitors so the responsive 3-up grid stays calm and Apple-like. */
  max-width: 1280px;
  width: 100%;
  margin-inline: auto;
  position: relative;
}

.fe30-factsheets-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.fe30-factsheets-titlewrap {
  min-width: 0;
  flex: 1 1 320px;
}

.fe30-factsheets-title {
  margin: 0;
  font-size: var(--text-4xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--dark-navy);
  line-height: var(--leading-tight);
}

.fe30-factsheets-subtitle {
  margin: var(--space-2) 0 0;
  font-size: var(--text-md);
  color: var(--gray-600);
  line-height: var(--leading-snug);
}

/* ============================================================
   HERO — single search card with quick-pick chips beneath
   ============================================================ */

.fe30-factsheets-hero {
  margin-bottom: var(--space-4);
}

.fe30-factsheets-hero-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.fe30-factsheets-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fe30-factsheets-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
}

.fe30-factsheets-search {
  width: 100%;
  padding: 10px 40px 10px 40px;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--ink-primary);
  background: var(--bg-gray-50);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition:
    border-color var(--duration-base) var(--ease-standard),
    background var(--duration-base) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard);
}

.fe30-factsheets-search::placeholder {
  color: var(--gray-500);
}

.fe30-factsheets-search:hover {
  background: var(--bg-white);
  border-color: var(--hairline);
}

.fe30-factsheets-search:focus {
  outline: none;
  background: var(--bg-white);
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--bg-gray-100);
  color: var(--gray-600);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.fe30-factsheets-search-clear:hover {
  background: var(--bg-gray-100);
  color: var(--dark-navy);
}

.fe30-factsheets-search-clear:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

/* ============================================================
   QUICK-PICK SUGGESTIONS
   ------------------------------------------------------------
   A single quiet row beneath the search input. Each chip uses
   `data-action="seed-search"` + `data-query="…"` to fill the
   search field and run the existing literal filter (no flag,
   no `coming soon` placeholder). When intelligent search ships,
   the controller can route conversational queries through the
   AI module without touching this markup.
   ============================================================ */

.fe30-factsheets-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-600);
}

.fe30-factsheets-suggestions-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-right: 2px;
}

.fe30-factsheets-suggest-chip {
  appearance: none;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-primary);
  background: var(--bg-gray-50);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    border-color var(--duration-base) var(--ease-standard),
    background var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.fe30-factsheets-suggest-chip:hover {
  background: var(--bg-white);
  border-color: var(--brand-orange);
  color: var(--brand-orange-dark);
}

.fe30-factsheets-suggest-chip:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-suggestions-hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap;
}

.fe30-factsheets-suggestions-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 1px;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-gray-100);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--gray-700);
}

@media (max-width: 600px) {
  .fe30-factsheets-suggestions-hint {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* ============================================================
   ERROR BANNER
   ============================================================ */

.fe30-factsheets-error {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  color: #b91c1c;
  font-size: var(--text-sm);
}

.fe30-factsheets-error[hidden] {
  display: none;
}

.fe30-factsheets-error-msg {
  flex: 1 1 auto;
  min-width: 0;
}

.fe30-factsheets-error-retry {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: #b91c1c;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.fe30-factsheets-error-retry:hover {
  background: rgba(239, 68, 68, 0.06);
}

/* ============================================================
   CLIENT-CONTEXT BANNER (Phase 6)
   ------------------------------------------------------------
   Appears above the toolbar when the page is opened with
   `?clientId=…`. Tells the advisor "you're seeing a curated
   list" and offers a one-click "Clear" to drop back to the
   full library. Uses the IAMS orange accent so it reads as a
   gentle scope marker rather than an error/warning.
   ============================================================ */

.fe30-factsheets-client-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, rgba(251, 106, 24, 0.06), rgba(253, 188, 151, 0.10));
  border: 1px solid rgba(251, 106, 24, 0.18);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.fe30-factsheets-client-banner-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(251, 106, 24, 0.14);
  color: var(--brand-orange);
  flex-shrink: 0;
}

.fe30-factsheets-client-banner-text {
  flex: 1 1 auto;
  min-width: 0;
}

.fe30-factsheets-client-banner-clear {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--bg-white);
  color: var(--brand-orange);
  border: 1px solid rgba(251, 106, 24, 0.25);
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}

.fe30-factsheets-client-banner-clear:hover {
  background: rgba(251, 106, 24, 0.08);
}

.fe30-factsheets-client-banner-clear:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 2px;
}

/* ============================================================
   TOOLBAR (sticky filter chips + sort + view toggle)
   ============================================================ */

.fe30-factsheets-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-3);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-translucent);
  -webkit-backdrop-filter: var(--backdrop-saturate-blur);
  backdrop-filter: var(--backdrop-saturate-blur);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-base) var(--ease-standard);
}

.fe30-main-column.is-scrolled .fe30-factsheets-toolbar {
  border-bottom-color: var(--hairline);
}

.fe30-factsheets-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
}

.fe30-factsheets-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-pill);
  background: var(--bg-white);
  color: var(--dark-navy);
  cursor: pointer;
  transition:
    border-color var(--duration-base) var(--ease-standard),
    background var(--duration-base) var(--ease-standard);
}

.fe30-factsheets-filter-btn:hover {
  border-color: var(--brand-orange);
  background: var(--brand-orange-light);
}

.fe30-factsheets-filter-btn[aria-expanded="true"],
.fe30-factsheets-filter-btn.is-active {
  border-color: var(--brand-orange);
  background: var(--brand-orange-light);
  color: var(--brand-orange-dark);
}

.fe30-factsheets-filter-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-filter-caret {
  font-size: 10px;
  color: var(--gray-500);
}

.fe30-factsheets-filter-clear {
  margin-left: auto;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-600);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-md);
}

.fe30-factsheets-filter-clear:hover {
  color: var(--brand-orange-dark);
  background: var(--brand-orange-light);
}

.fe30-factsheets-filter-clear:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-filter-clear[hidden] {
  display: none;
}

/* Sort + view toggle on the right side of the toolbar. */
.fe30-factsheets-controls {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.fe30-factsheets-control-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.fe30-factsheets-sort,
.fe30-factsheets-view {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 7px 12px 7px 12px;
  background: var(--bg-white);
  color: var(--dark-navy);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.fe30-factsheets-sort:focus-visible,
.fe30-factsheets-view:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
  border-color: var(--brand-orange);
}

/* Active-filter chip row — shows the user every dimension currently
   constraining the grid so they can pop them off quickly. */
.fe30-factsheets-active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.fe30-factsheets-active-chips[hidden] {
  display: none;
}

.fe30-factsheets-active-chips .fe30-chip {
  background: var(--brand-orange-light);
  color: var(--brand-orange-dark);
  border-color: rgba(251, 106, 24, 0.25);
}

/* Result count line above the grid. */
.fe30-factsheets-resultline {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* ============================================================
   PINNED + RECENTS ROWS (Phase 3)
   ============================================================ */

.fe30-factsheets-strip {
  margin-bottom: var(--space-6);
}

.fe30-factsheets-strip[hidden] {
  display: none;
}

.fe30-factsheets-strip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.fe30-factsheets-strip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================================
   GRID + CARD
   ============================================================ */

.fe30-factsheets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
  /* `content-visibility: auto` lets the browser skip layout/paint for
     offscreen cards. Saves frames on firms with hundreds of factsheets. */
  content-visibility: auto;
  contain-intrinsic-size: 320px 360px;
}

.fe30-factsheets-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.fe30-factsheets-card:hover {
  transform: translateY(-1px);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-md);
}

.fe30-factsheets-card.is-selected {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(251, 106, 24, 0.18), var(--shadow-md);
}

/* Big preview area — primary action target. */
.fe30-factsheets-card-preview {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--bg-gray-100);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fe30-factsheets-card-preview:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Slight lift on hover so the card feels tactile. */
  transition: transform var(--duration-base) var(--ease-standard);
}

.fe30-factsheets-card-preview:hover img {
  transform: scale(1.02);
}

.fe30-factsheets-card-preview--landscape img {
  object-fit: contain;
  background: var(--bg-white);
}

.fe30-factsheets-card-preview--no-image {
  background: var(--bg-gray-50);
  color: var(--gray-400);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Star (favorite) toggle in the top-right of the preview. */
.fe30-factsheets-card-star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--gray-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition:
    color var(--duration-base) var(--ease-standard),
    background var(--duration-base) var(--ease-standard);
}

.fe30-factsheets-card-star:hover {
  color: var(--brand-orange-dark);
}

.fe30-factsheets-card-star.is-active {
  color: var(--brand-orange);
}

.fe30-factsheets-card-star:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-card-select {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand-orange);
}

.fe30-factsheets-card-body {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.fe30-factsheets-card-text {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fe30-factsheets-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--dark-navy);
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.fe30-factsheets-card-meta {
  font-size: var(--text-xs);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fe30-factsheets-card-meta-dot::before {
  content: "·";
  margin: 0 2px;
  color: var(--gray-400);
}

.fe30-factsheets-card-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-gray-100);
  color: var(--gray-700);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fe30-factsheets-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
}

.fe30-factsheets-card-actions .fe30-btn {
  font-size: 13px;
  padding: 7px 12px;
}

.fe30-factsheets-card-menu {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-left: auto;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--gray-500);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.fe30-factsheets-card-menu:hover {
  border-color: var(--hairline);
  background: var(--bg-gray-50);
  color: var(--dark-navy);
}

.fe30-factsheets-card-menu:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-card-popmenu {
  position: absolute;
  top: 100%;
  right: var(--space-2);
  margin-top: var(--space-1);
  min-width: 200px;
  padding: var(--space-2) 0;
  background: var(--bg-white);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  list-style: none;
}

.fe30-factsheets-card-popmenu button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  color: var(--gray-700);
  cursor: pointer;
}

.fe30-factsheets-card-popmenu button:hover {
  background: var(--bg-gray-50);
  color: var(--dark-navy);
}

/* Group-by-Manager view — sections with a header strip + a nested grid. */
.fe30-factsheets-group {
  margin-bottom: var(--space-6);
}

.fe30-factsheets-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
}

.fe30-factsheets-group-name {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--dark-navy);
  letter-spacing: var(--tracking-tight);
}

.fe30-factsheets-group-count {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* ============================================================
   EMPTY / SKELETON
   ============================================================ */

.fe30-factsheets-empty {
  padding: var(--space-10) var(--space-6);
  text-align: center;
  background: var(--bg-white);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.fe30-factsheets-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  color: var(--gray-400);
}

.fe30-factsheets-empty-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--dark-navy);
}

.fe30-factsheets-empty-sub {
  margin: 0 auto var(--space-4);
  max-width: 440px;
  color: var(--gray-600);
  font-size: var(--text-md);
}

.fe30-factsheets-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
}

.fe30-factsheets-skel-tile {
  height: 320px;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    90deg,
    var(--bg-gray-100) 0%,
    var(--bg-gray-50) 50%,
    var(--bg-gray-100) 100%
  );
  background-size: 200% 100%;
  animation: fe30-skeleton-shimmer 1.4s var(--ease-standard) infinite;
}

/* ============================================================
   POPOVER (filter dropdowns)
   ============================================================ */

.fe30-factsheets-popover {
  position: absolute;
  z-index: 40;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 24px));
  max-height: min(360px, 70vh);
  overflow: auto;
  padding: var(--space-3);
  background: var(--bg-white);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.fe30-factsheets-popover[hidden] {
  display: none;
}

.fe30-factsheets-popover-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.fe30-factsheets-popover-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fe30-factsheets-popover-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--ink-primary);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.fe30-factsheets-popover-item:hover {
  background: var(--bg-gray-50);
  color: var(--dark-navy);
}

.fe30-factsheets-popover-item.is-active {
  background: var(--brand-orange-light);
  color: var(--brand-orange-dark);
  font-weight: 600;
}

.fe30-factsheets-popover-item:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

/* Label/count layout inside a popover row.
   The label flexes to take all available width so the count snaps to
   the right edge in a clean column down the menu. The count uses a
   smaller, muted treatment so the option name still reads first; an
   `aria-label` on the count carries the unit ("12 factsheets"). */
.fe30-factsheets-popover-item-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fe30-factsheets-popover-item-count {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.fe30-factsheets-popover-item.is-active .fe30-factsheets-popover-item-count {
  color: var(--brand-orange-dark);
}

/* ============================================================
   PREVIEW DRAWER (Phase 2)
   ============================================================ */

.fe30-factsheets-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-pane) var(--ease-spring);
  z-index: 200;
}

.fe30-factsheets-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fe30-factsheets-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100vw);
  background: var(--bg-white);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--duration-pane) var(--ease-spring);
  z-index: 210;
  display: flex;
  flex-direction: column;
  outline: none;
}

.fe30-factsheets-drawer.is-open {
  transform: translateX(0);
}

.fe30-factsheets-drawer-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--hairline);
}

.fe30-factsheets-drawer-titlewrap {
  flex: 1 1 auto;
  min-width: 0;
}

.fe30-factsheets-drawer-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--dark-navy);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fe30-factsheets-drawer-meta {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.fe30-factsheets-drawer-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--bg-white);
  color: var(--gray-600);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fe30-factsheets-drawer-close:hover {
  border-color: var(--gray-400);
  color: var(--dark-navy);
}

.fe30-factsheets-drawer-close:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus-orange);
}

.fe30-factsheets-drawer-body {
  flex: 1 1 auto;
  background: var(--bg-gray-100);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
}

.fe30-factsheets-drawer-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-white);
}

.fe30-factsheets-drawer-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--hairline);
  background: var(--bg-white);
}

/* ============================================================
   BULK ACTION BAR (Phase 4)
   ============================================================ */

.fe30-factsheets-bulkbar {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--dark-navy);
  color: #fff;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--duration-base) var(--ease-emphasized),
    transform var(--duration-base) var(--ease-emphasized);
}

.fe30-factsheets-bulkbar.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.fe30-factsheets-bulkbar-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fe30-factsheets-bulkbar .fe30-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.fe30-factsheets-bulkbar .fe30-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.fe30-factsheets-bulkbar .fe30-btn-primary {
  background: var(--brand-orange);
  border-color: transparent;
}

.fe30-factsheets-bulkbar .fe30-btn-primary:hover {
  background: var(--brand-orange-dark);
}

/* ============================================================
   TOAST + LIVE REGION
   ============================================================ */

.fe30-factsheets-toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 400;
  padding: 12px 16px;
  background: var(--dark-navy);
  color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  max-width: 360px;
  animation: fe30-factsheets-toast-in var(--duration-base) var(--ease-emphasized);
}

.fe30-factsheets-toast[hidden] {
  display: none;
}

@keyframes fe30-factsheets-toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fe30-factsheets-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   MOBILE TWEAKS
   ============================================================ */

@media (max-width: 640px) {
  .fe30-factsheets-header {
    flex-direction: column;
    align-items: stretch;
  }

  .fe30-factsheets-search {
    font-size: var(--text-base);
    padding: 11px 38px 11px 38px;
  }

  .fe30-factsheets-title {
    font-size: var(--text-3xl);
  }

  .fe30-factsheets-controls {
    width: 100%;
  }

  .fe30-factsheets-sort,
  .fe30-factsheets-view {
    flex: 1 1 0;
  }
}
