/*
 * Knowledge Hub — application styles
 * ---------------------------------
 * Uses ONLY CSS custom properties from css/tokens.css (design_tokens/).
 *
 * Home layout: Figma node 375:5826 — header + Dezerv wordmark, quick links,
 * section tiles, recently viewed; dock from 374:4984 (#191919 pill).
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--type-para-default-regular-font-family);
  font-size: var(--type-para-default-regular-font-size);
  font-weight: var(--type-para-default-regular-font-weight);
  line-height: var(--type-para-default-regular-line-height);
  letter-spacing: var(--type-para-default-regular-letter-spacing);
  color: var(--color-neutral-text-primary);
  background-color: var(--color-neutral-background-secondary);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* -------------------------------------------------------------------------- */
/* Main scroll region — bottom padding clears the fixed dock                  */
/* -------------------------------------------------------------------------- */

/*
 * Horizontal inset — roomy default; at viewports ≥1280px use exactly 100px each side
 * (per layout spec). Vertical padding clears the fixed dock.
 */
.main {
  flex: 1;
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 2.5rem clamp(1.5rem, 6vw, 6rem) 7.5rem;
}

@media (min-width: 1280px) {
  .main {
    padding-left: 100px;
    padding-right: 100px;
  }
}

/* -------------------------------------------------------------------------- */
/* Home — Figma 375:5826: page title + Dezerv SVG, stacked panels             */
/* -------------------------------------------------------------------------- */

.home {
  width: 100%;
}

/* page header: Knowledge Hub left, logo right (layout_A32ZO8) */
.home-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.home-top__title {
  margin: 0;
  font-family: var(--type-heading-default-font-family);
  font-size: var(--type-heading-default-font-size);
  font-weight: var(--type-heading-default-font-weight);
  line-height: var(--type-heading-default-line-height);
  letter-spacing: var(--type-heading-default-letter-spacing);
  color: var(--color-neutral-text-primary);
}

.home-top__logo {
  display: flex;
  align-items: center;
  color: var(--color-neutral-text-primary);
}

.home-dezerv-logo {
  display: block;
  height: 0.875rem;
  width: auto;
  min-width: 5rem;
}

.home-dezerv-logo text {
  font-family: Inter, system-ui, sans-serif;
}

.home-stack {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-panel__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.home-panel__icon {
  display: flex;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-neutral-text-tertiary);
}

.home-panel__icon svg {
  width: 100%;
  height: 100%;
}

.home-panel__label {
  margin: 0;
  flex-shrink: 0;
  font-family: var(--type-line-small-medium-font-family);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-neutral-text-tertiary);
}

.home-panel__rule {
  flex: 1;
  margin: 0;
  border: none;
  border-top: 1px solid var(--color-neutral-border-primary);
  height: 0;
}

/* Section tiles: dock-matching 256×256 icons; quick links / panels: Heroicons 24×24 */
.home-card-icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  background-color: var(--color-neutral-background-secondary);
  color: var(--color-neutral-text-secondary);
}

.home-card-icon--muted {
  opacity: 0.65;
}

.home-card-icon__svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Quick links — full-card link, equal height per grid row */
.home-quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}

@media (min-width: 36rem) {
  .home-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .home-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 75rem) {
  .home-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-quick-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: stretch;
  height: 100%;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 0.5rem;
  background-color: var(--color-neutral-background-primary);
  border: none;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.24s ease;
}

.home-quick-card .home-card-icon {
  width: 2.25rem;
  height: 2.25rem;
}

.home-quick-card .home-card-icon__svg {
  width: 1.25rem;
  height: 1.25rem;
}

.home-quick-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--color-neutral-background-action-primary);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.32s ease;
  z-index: 0;
}

.home-quick-card > * {
  position: relative;
  z-index: 1;
}

.home-quick-card:hover::before,
.home-quick-card:focus-visible::before {
  transform: scaleY(1);
}

.home-quick-card:hover .home-quick-card__title,
.home-quick-card:focus-visible .home-quick-card__title {
  color: var(--color-neutral-text-action-primary);
}

.home-quick-card:focus-visible {
  outline: 2px solid var(--color-neutral-border-focused);
  outline-offset: 2px;
}

.home-quick-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.home-quick-card__title {
  font-family: var(--type-line-large-bold-font-family);
  font-size: var(--type-line-large-bold-font-size);
  font-weight: var(--type-line-large-bold-font-weight);
  line-height: var(--type-line-large-bold-line-height);
  letter-spacing: var(--type-line-large-bold-letter-spacing);
  color: var(--color-neutral-text-primary);
}

/* Section / recent tiles — equal-width columns (grid, not flex wrap) */
.home-sections-grid {
  display: grid;
  gap: 1rem;
  align-items: stretch;
  grid-template-columns: 1fr;
}

@media (min-width: 36rem) {
  .home-sections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .home-sections-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 75rem) {
  .home-sections-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* Keep only the Home "Sections" panel at 3 columns (3x2 for 6 cards). */
  .home-panel[aria-labelledby="home-sections-heading"] .home-sections-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.home-section-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
  min-height: 11rem;
  padding: 1.25rem;
  border-radius: 0.5rem;
  background-color: var(--color-neutral-background-primary);
  border: none;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.24s ease;
}

.home-section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--color-neutral-background-action-primary);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.32s ease;
  z-index: 0;
}

.home-section-card > * {
  position: relative;
  z-index: 1;
}

/* Icon on its own row; don’t stretch the square to full card width */
.home-section-card > .home-card-icon {
  align-self: flex-start;
}

.home-section-card:hover::before,
.home-section-card:focus-visible::before {
  transform: scaleY(1);
}

.home-section-card:hover .home-card-icon,
.home-section-card:focus-visible .home-card-icon {
  background-color: var(
    --home-section-icon-hover-bg,
    var(--color-neutral-background-action-secondary)
  );
  color: var(
    --home-section-icon-hover-fg,
    var(--color-neutral-icon-action-primary)
  );
}

.home-quick-card:hover .home-card-icon,
.home-quick-card:focus-visible .home-card-icon {
  background-color: var(--color-neutral-background-action-secondary);
  color: var(--color-neutral-icon-action-primary);
}

.home-section-card:hover .home-section-card__title,
.home-section-card:focus-visible .home-section-card__title {
  color: var(--color-neutral-text-action-primary);
}

.home-section-card:hover .home-section-card__desc,
.home-section-card:focus-visible .home-section-card__desc,
.home-section-card:hover .home-section-card__meta,
.home-section-card:focus-visible .home-section-card__meta {
  color: var(--color-neutral-text-action-secondary);
}

.home-section-card:hover .home-section-card__dot,
.home-section-card:focus-visible .home-section-card__dot {
  color: var(--color-neutral-text-action-primary);
}

.home-section-card:focus-visible {
  outline: 2px solid var(--color-neutral-border-focused);
  outline-offset: 2px;
}

.home-section-card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.home-section-card__title {
  margin: 0;
  font-family: var(--type-heading-small-font-family);
  font-size: var(--type-heading-small-font-size);
  font-weight: var(--type-heading-small-font-weight);
  line-height: var(--type-heading-small-line-height);
  letter-spacing: var(--type-heading-small-letter-spacing);
  color: var(--color-neutral-text-primary);
  padding-bottom: 0.5rem;
}

.home-section-card__desc {
  margin: 0;
  flex: 1;
  font-family: var(--type-para-default-regular-font-family);
  font-size: var(--type-para-default-regular-font-size);
  font-weight: var(--type-para-default-regular-font-weight);
  line-height: var(--type-para-default-regular-line-height);
  letter-spacing: var(--type-para-default-regular-letter-spacing);
  color: var(--color-neutral-text-tertiary);
}

.home-section-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.home-section-card__meta {
  font-family: var(--type-line-small-medium-font-family);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-neutral-text-tertiary);
}

.home-section-card__dot {
  font-family: var(--type-line-small-medium-font-family);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-neutral-text-tertiary);
}

.home-recent-empty-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  max-width: 42rem;
  border-radius: 0.5rem;
  border: 1px dashed var(--color-neutral-border-primary);
  background-color: var(--color-neutral-background-primary);
}

.home-recent-empty {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--type-para-default-regular-font-family);
  font-size: var(--type-para-default-regular-font-size);
  color: var(--color-neutral-text-tertiary);
}

/* -------------------------------------------------------------------------- */
/* Bottom dock — dark pill, icon-only destinations, sliding indicator         */
/* -------------------------------------------------------------------------- */

.dock {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  padding-bottom: env(safe-area-inset-bottom, 0);
  pointer-events: none;
}

.dock__pill {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 100px;
  background-color: var(--color-neutral-background-action-primary);
  pointer-events: auto;
  box-shadow: 0 8px 32px var(--color-helper-alpha-overlay);
  overflow: visible;
}

/*
 * Sliding highlight — morphs into a slim horizontal blob mid-travel (keyframes + CSS vars from JS).
 */
@keyframes dock-indicator-blob {
  0% {
    transform: translateX(var(--dock-blob-from, 0px)) scale(1, 1);
    border-radius: 100px;
  }
  11% {
    transform: translateX(var(--dock-blob-from, 0px)) scale(1.1, 0.76);
    border-radius: 100px;
  }
  50% {
    transform: translateX(var(--dock-blob-mid, 0px)) scale(1.38, 0.52);
    border-radius: 999px;
  }
  89% {
    transform: translateX(var(--dock-blob-to, 0px)) scale(1.08, 0.8);
    border-radius: 100px;
  }
  100% {
    transform: translateX(var(--dock-blob-to, 0px)) scale(1, 1);
    border-radius: 100px;
  }
}

.dock__indicator {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 100px;
  background-color: var(--color-helper-main-always-white);
  transform: translateX(0);
  transform-origin: center center;
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  z-index: 0;
}

.dock__indicator.dock__indicator--blob-travel {
  transition: none;
  animation: dock-indicator-blob var(--dock-blob-duration, 0.26s) cubic-bezier(0.33, 1, 0.68, 1) both;
}

[data-theme="dark"] .dock__indicator {
  box-shadow: 0 0 0 1px var(--color-neutral-border-secondary);
}

.dock__btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  color: var(--color-neutral-icon-tertiary);
  background: transparent;
  transition: color 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/*
 * Hover label — uses `data-tooltip` from JS (destination display name).
 */
.dock__btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 200;
  padding: 0.35rem 0.55rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  font-family: var(--type-line-small-medium-font-family);
  font-size: var(--type-line-small-medium-font-size);
  font-weight: var(--type-line-small-medium-font-weight);
  line-height: var(--type-line-small-medium-line-height);
  color: var(--color-neutral-text-primary);
  background-color: var(--color-neutral-background-primary);
  border: 1px solid var(--color-neutral-border-primary);
  box-shadow: 0 4px 16px var(--color-helper-alpha-overlay);
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock__btn[data-tooltip]:hover::after,
.dock__btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock__btn:hover:not(.is-active) {
  color: var(--color-neutral-text-action-primary);
}

.dock__btn:hover,
.dock__btn:focus-visible {
  transform: scale(1.08);
}

.dock__btn.is-active {
  color: var(--color-helper-main-always-black);
}

.dock__btn[data-nav="starred"]:not(.is-active) {
  color: var(--color-neutral-icon-tertiary);
}

.dock__btn[data-action="spotlight"] {
  color: var(--color-neutral-icon-action-secondary);
}

.dock__btn[data-action="spotlight"]:hover,
.dock__btn[data-action="spotlight"]:focus-visible {
  color: var(--color-neutral-icon-action-primary);
}

.dock__btn:active {
  transform: scale(0.92);
}

.dock__btn svg {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
  color: inherit;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Shapes must not rely on svg-level stroke only — <circle> (search) can keep fill/stroke UA defaults otherwise. */
.dock__btn svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: inherit;
  stroke-linecap: inherit;
  stroke-linejoin: inherit;
}

.dock__btn[data-nav="starred"] svg *,
.dock__btn[data-nav="operations"] svg *,
.dock__btn[data-nav="call-library"] svg *,
.dock__btn[data-nav="platforms"] svg *,
.dock__btn[data-nav="dezerv-sales"] svg *,
.dock__btn[data-nav="home"] svg *,
.dock__btn[data-nav="fundamentals"] svg *,
.dock__btn[data-action="spotlight"] svg * {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linejoin: round;
  paint-order: stroke fill;
}

.home-card-icon__svg,
.home-panel__icon svg,
.fund-pill__icon,
.fund-section-acc__chev-icon,
.fund-card__star-icon,
.spotlight__icon svg {
  stroke-width: 0.5rem;
}

.home-card-icon__svg *,
.home-panel__icon svg *,
.fund-pill__icon *,
.fund-section-acc__chev-icon *,
.fund-card__star-icon *,
.spotlight__icon svg * {
  stroke-width: 1.75;
}

@media (prefers-reduced-motion: reduce) {
  .dock__indicator {
    transition: none;
  }

  .dock__indicator.dock__indicator--blob-travel {
    animation: none;
  }

  .home-quick-card,
  .home-section-card {
    transition: none;
  }

  .home-quick-card:hover,
  .home-section-card:hover {
    transform: none;
  }

  .dock__btn:active {
    transform: none;
  }

  .dock__btn[data-tooltip]::after {
    transition: none;
  }

  .spotlight__backdrop,
  .spotlight__dialog {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Spotlight — bottom sheet-style panel + scrim                               */
/* -------------------------------------------------------------------------- */

@keyframes spotlight-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spotlight-dialog-in {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.spotlight-is-open {
  overflow: hidden;
}

/*
 * `hidden` must win: a bare `display: flex` here overrides the attribute in some
 * engines, so the search overlay appeared on every page load.
 */
.spotlight[hidden] {
  display: none !important;
}

.spotlight:not([hidden]) {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 0 1rem max(1rem, env(safe-area-inset-bottom, 0px));
}

.spotlight:not([hidden]) .spotlight__backdrop {
  animation: spotlight-backdrop-in 0.32s ease-out both;
}

.spotlight__backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--color-helper-alpha-overlay);
  backdrop-filter: blur(6px);
  opacity: 0;
}

.spotlight:not([hidden]) .spotlight__dialog {
  animation: spotlight-dialog-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.spotlight__dialog {
  position: relative;
  width: 100%;
  max-width: 36rem;
  max-height: min(75vh, 40rem);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-neutral-border-primary);
  background-color: var(--color-neutral-background-primary);
  box-shadow: 0 24px 48px var(--color-helper-alpha-overlay);
  opacity: 0;
}

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

.spotlight__field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-neutral-border-primary);
  background-color: var(--color-neutral-background-secondary);
}

.spotlight__icon {
  display: flex;
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-neutral-icon-secondary);
}

.spotlight__icon svg {
  width: 100%;
  height: 100%;
}

.spotlight__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--type-line-large-regular-font-family);
  font-size: var(--type-line-large-regular-font-size);
  font-weight: var(--type-line-large-regular-font-weight);
  line-height: var(--type-line-large-regular-line-height);
  color: var(--color-neutral-text-primary);
}

.spotlight__input:focus {
  outline: none;
}

.spotlight__input::placeholder {
  color: var(--color-neutral-text-tertiary);
}

.spotlight__results {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.spotlight__results li {
  margin: 0;
  padding: 0;
}

.spotlight__hit {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.5rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.12s ease;
}

.spotlight__hit:hover,
.spotlight__hit:focus-visible {
  background-color: var(--color-neutral-background-secondary);
  outline: none;
}

.spotlight__hit-title {
  font-family: var(--type-line-large-medium-font-family);
  font-size: var(--type-line-large-medium-font-size);
  font-weight: var(--type-line-large-medium-font-weight);
  color: var(--color-neutral-text-primary);
}

.spotlight__hit-meta {
  font-family: var(--type-line-small-regular-font-family);
  font-size: var(--type-line-small-regular-font-size);
  color: var(--color-neutral-text-tertiary);
}

.spotlight__empty {
  padding: 1rem 0.5rem;
  font-family: var(--type-para-small-regular-font-family);
  font-size: var(--type-para-small-regular-font-size);
  color: var(--color-neutral-text-tertiary);
}

/* -------------------------------------------------------------------------- */
/* Inner pages (sheet views): title + hierarchy                               */
/* -------------------------------------------------------------------------- */

.page-head {
  margin-bottom: 1.75rem;
}

.page-head__title {
  margin: 0 0 0.4rem;
  font-family: var(--type-heading-default-font-family);
  font-size: var(--type-heading-default-font-size);
  font-weight: var(--type-heading-default-font-weight);
  line-height: var(--type-heading-default-line-height);
  letter-spacing: var(--type-heading-default-letter-spacing);
  color: var(--color-neutral-text-primary);
}

.page-head__sub {
  margin: 0;
  font-family: var(--type-line-large-regular-font-family);
  font-size: var(--type-line-large-regular-font-size);
  font-weight: var(--type-line-large-regular-font-weight);
  line-height: var(--type-line-large-regular-line-height);
  letter-spacing: var(--type-line-large-regular-letter-spacing);
  color: var(--color-neutral-text-secondary);
}

.section-block {
  margin-bottom: 2.25rem;
}

.section-block__title {
  display: inline-block;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primitive-hue-brown-400);
  font-family: var(--type-heading-default-font-family);
  font-size: var(--type-heading-default-font-size);
  font-weight: var(--type-heading-default-font-weight);
  line-height: var(--type-heading-default-line-height);
  letter-spacing: var(--type-heading-default-letter-spacing);
  color: var(--color-neutral-text-primary);
}

.subsection {
  margin: 1.25rem 0 1rem 0.5rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--color-neutral-border-secondary);
}

.subsection__title {
  margin: 0 0 0.65rem;
  font-family: var(--type-heading-small-font-family);
  font-size: var(--type-heading-small-font-size);
  font-weight: var(--type-heading-small-font-weight);
  line-height: var(--type-heading-small-line-height);
  color: var(--color-neutral-text-primary);
}

.sub-sub {
  margin: 0.85rem 0 0.65rem 0.75rem;
}

.sub-sub__title {
  margin: 0 0 0.5rem;
  font-family: var(--type-line-large-bold-font-family);
  font-size: var(--type-line-large-bold-font-size);
  font-weight: var(--type-line-large-bold-font-weight);
  line-height: var(--type-line-large-bold-line-height);
  color: var(--color-neutral-text-secondary);
}

.sub-sub-sub {
  margin: 0.65rem 0 0.5rem 1rem;
}

.sub-sub-sub__title {
  margin: 0 0 0.45rem;
  font-family: var(--type-uppercase-default-font-family);
  font-size: var(--type-uppercase-default-font-size);
  font-weight: var(--type-uppercase-default-font-weight);
  line-height: var(--type-uppercase-default-line-height);
  letter-spacing: var(--type-uppercase-default-letter-spacing);
  text-transform: uppercase;
  color: var(--color-neutral-text-tertiary);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.card {
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  border: none;
  background-color: var(--color-neutral-background-primary);
  box-shadow: 0 1px 2px var(--color-helper-alpha-primary-zero-percent);
}

.card__title {
  margin: 0 0 0.45rem;
  font-family: var(--type-line-large-bold-font-family);
  font-size: var(--type-line-large-bold-font-size);
  font-weight: var(--type-line-large-bold-font-weight);
  line-height: var(--type-line-large-bold-line-height);
  color: var(--color-neutral-text-primary);
}

.card__desc {
  margin: 0 0 0.85rem;
  white-space: pre-wrap;
  font-family: var(--type-para-default-regular-font-family);
  font-size: var(--type-para-default-regular-font-size);
  font-weight: var(--type-para-default-regular-font-weight);
  line-height: var(--type-para-default-regular-line-height);
  color: var(--color-neutral-text-secondary);
}

.card__empty {
  margin: 0;
  font-family: var(--type-para-small-regular-font-family);
  font-size: var(--type-para-small-regular-font-size);
  font-style: italic;
  color: var(--color-neutral-text-tertiary);
}

.link-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.link-group__label {
  margin-bottom: 0.35rem;
  font-family: var(--type-uppercase-default-font-family);
  font-size: var(--type-uppercase-default-font-size);
  font-weight: var(--type-uppercase-default-font-weight);
  line-height: var(--type-uppercase-default-line-height);
  letter-spacing: var(--type-uppercase-default-letter-spacing);
  color: var(--color-neutral-text-tertiary);
}

.link-group__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.link-group__buttons a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  border: none;
  text-decoration: none;
  font-family: var(--type-line-small-medium-font-family);
  font-size: var(--type-line-small-medium-font-size);
  font-weight: var(--type-line-small-medium-font-weight);
  line-height: var(--type-line-small-medium-line-height);
  color: var(--color-neutral-text-action-primary);
  background-color: var(--color-neutral-background-action-primary);
  transition: opacity 0.15s ease;
}

.link-group__buttons a:hover {
  opacity: 0.88;
}

/* -------------------------------------------------------------------------- */
/* Fundamentals — Figma node 374:2301 (resources): header, accordion, cards   */
/* -------------------------------------------------------------------------- */

.fund-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.fund-page-head__copy {
  min-width: 0;
}

.fund-page-head__title {
  margin: 0 0 0.5rem;
  font-family: var(--type-heading-default-font-family);
  font-size: var(--type-heading-default-font-size);
  font-weight: var(--type-heading-default-font-weight);
  line-height: var(--type-heading-default-line-height);
  letter-spacing: var(--type-heading-default-letter-spacing);
  color: var(--color-neutral-text-primary);
}

.fund-page-head__intro {
  margin: 0;
  max-width: 36rem;
  font-family: var(--type-line-large-regular-font-family);
  font-size: var(--type-line-large-regular-font-size);
  font-weight: var(--type-line-large-regular-font-weight);
  line-height: var(--type-line-large-regular-line-height);
  letter-spacing: var(--type-line-large-regular-letter-spacing);
  color: var(--color-neutral-text-secondary);
}

.fund-page-head__logo {
  display: flex;
  align-items: center;
  color: var(--color-neutral-text-primary);
}

.sheet-body--fundamentals {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fund-section-acc {
  border-radius: 0.5rem;
  border: 1px solid var(--primitive-gray-200);
  background-color: var(--primitive-gray-50);
  overflow: hidden;
}

.fund-section-acc--static {
  border-radius: 0.5rem;
  border: 1px solid var(--primitive-gray-200);
  background-color: var(--primitive-gray-50);
}

.fund-section-acc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  list-style: none;
}

.fund-section-acc__summary::-webkit-details-marker {
  display: none;
}

.fund-section-acc__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.fund-section-acc__heading {
  font-family: var(--type-heading-small-font-family);
  font-size: var(--type-heading-small-font-size);
  font-weight: var(--type-heading-small-font-weight);
  line-height: var(--type-heading-small-line-height);
  letter-spacing: var(--type-heading-small-letter-spacing);
  color: var(--color-neutral-text-primary);
}

.fund-section-acc__intro {
  font-family: var(--type-line-large-regular-font-family);
  font-size: var(--type-line-large-regular-font-size);
  font-weight: var(--type-line-large-regular-font-weight);
  line-height: var(--type-line-large-regular-line-height);
  letter-spacing: var(--type-line-large-regular-letter-spacing);
  color: var(--color-neutral-text-secondary);
}

.fund-section-acc__chev {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-text-secondary);
}

.fund-section-acc__chev-icon {
  display: block;
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.fund-section-acc[open] .fund-section-acc__chev-icon {
  transform: rotate(180deg);
}

.fund-section-acc__panel {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fund-section-acc--static .fund-section-acc__panel {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Nested accordion: e.g. Wealth Management 101 under Finance */
.fund-sub-acc__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  cursor: pointer;
  list-style: none;
}

.fund-sub-acc__summary::-webkit-details-marker {
  display: none;
}

.fund-sub-acc__head {
  flex: 1;
  min-width: 0;
}

.fund-sub-acc__chev {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-text-secondary);
}

.fund-sub-acc[open] .fund-section-acc__chev-icon {
  transform: rotate(180deg);
}

.fund-sub-acc__panel {
  padding: 0.5rem 0 0;
}

.fund-subsection__title {
  margin: 0;
  font-family: var(--type-uppercase-bold-font-family);
  font-size: var(--type-uppercase-bold-font-size);
  font-weight: var(--type-uppercase-bold-font-weight);
  line-height: var(--type-uppercase-bold-line-height);
  letter-spacing: var(--type-uppercase-bold-letter-spacing);
  text-transform: uppercase;
  color: var(--color-neutral-text-secondary);
}

.fund-cards {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 17.375rem), 1fr)
  );
  gap: 0.75rem;
  align-items: stretch;
}

/* Bookmarked page: same fund-cards as section pages, primary surface + equal row heights */
.fund-cards.bookmarked-list {
  align-items: stretch;
}

.fund-cards.bookmarked-list > .bookmark-entry {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  height: 100%;
}

.fund-cards.bookmarked-list .fund-card {
  flex: 1 1 auto;
  min-height: 19.4375rem;
  max-height: none;
  background-color: var(--color-neutral-background-primary);
  box-shadow: 0 1px 2px var(--color-helper-alpha-primary-zero-percent);
}

.fund-cards.bookmarked-list .fund-card.fund-card--compact {
  min-height: 14.50rem;
  max-height: 14.50rem;
}

.fund-card {
  display: flex;
  flex-direction: column;
  min-height: 19.50rem;
  max-height: 19.50rem;
  padding: 1.25rem;
  border-radius: 0.5rem;
  background-color: var(--primitive-gray-100);
  overflow: visible;
}

.fund-card.hub-focus-flash {
  outline: 2px solid var(--color-neutral-border-focused);
  outline-offset: 2px;
  transition: outline-color 0.2s ease, outline-offset 0.2s ease;
}

.fund-card--compact {
  min-height: 14.50rem;
  max-height: 14.50rem;
  padding: 1.25rem;
}

.fund-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.fund-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.fund-card--no-tag .fund-card__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.fund-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 1.5rem;
  background-color: var(--primitive-hue-green-100);
  font-family: var(--type-text-tags-font-family);
  font-size: var(--type-text-tags-font-size);
  font-weight: var(--type-text-tags-font-weight);
  line-height: var(--type-text-tags-line-height);
  letter-spacing: var(--type-text-tags-letter-spacing);
  text-transform: uppercase;
  color: var(--primitive-gray-900);
}

.fund-card__star {
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--color-neutral-text-secondary);
  cursor: pointer;
  opacity: 1;
}

.fund-card__star:hover {
  color: var(--color-neutral-text-primary);
}

.fund-card__star.is-bookmarked {
  /* text-action-primary is light-on-dark in :root; cards use light surfaces */
  color: var(--color-neutral-text-primary);
}

.fund-card__star:focus-visible {
  outline: 2px solid var(--color-neutral-border-focused);
  outline-offset: 2px;
}

.fund-card--no-tag .fund-card__star {
  margin-left: 0;
}

.fund-card__star-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.bookmark-entry__source {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-neutral-text-tertiary);
}

.fund-card__content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fund-card--compact .fund-card__title-row {
  margin-bottom: 0.75rem;
}

.fund-card--compact .fund-card__top {
  margin-bottom: 0.75rem;
}

.fund-card--compact .fund-card__content {
  flex: 1 1 auto;
  gap: 0.5rem;
}

.fund-card__text {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  overflow: hidden;
}

.fund-card--compact .fund-card__text {
  flex: 1 1 auto;
  gap: 0.4375rem;
  overflow: hidden;
}

.fund-card__title {
  margin: 0;
  font-family: var(--type-line-large-bold-font-family);
  font-size: var(--type-line-large-bold-font-size);
  font-weight: var(--type-line-large-bold-font-weight);
  line-height: var(--type-line-large-bold-line-height);
  color: var(--color-neutral-text-primary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.fund-card__desc {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--type-para-small-regular-font-family);
  font-size: var(--type-para-small-regular-font-size);
  font-weight: var(--type-para-small-regular-font-weight);
  line-height: var(--type-para-small-regular-line-height);
  color: var(--color-neutral-text-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.fund-card__pills-wrap {
  flex-shrink: 0;
  margin-top: auto;
  min-height: 0;
}

.fund-card--compact .fund-card__pills-wrap {
  margin-top: auto;
}

.fund-card__empty {
  margin: 0;
  font-family: var(--type-para-small-regular-font-family);
  font-size: var(--type-para-small-regular-font-size);
  font-style: italic;
  color: var(--color-neutral-text-tertiary);
}

.fund-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-content: flex-start;
}

.fund-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-neutral-background-action-primary);
  background-color: var(--color-neutral-background-action-primary);
  text-decoration: none;
  color: var(--color-neutral-text-action-primary);
  box-shadow: inset 0 0 0 0 var(--color-helper-states-pressed-inverted);
  transition: background-color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
}

.fund-pill--full {
  width: auto;
  min-height: 2rem;
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  gap: 0.375rem;
}

.fund-pill:hover {
  background-color: var(--color-neutral-background-action-primary);
  border-color: var(--color-neutral-background-action-primary);
  color: var(--color-neutral-text-action-primary);
  box-shadow: inset 0 0 0 999px var(--color-helper-states-pressed-inverted);
}

.fund-pill:focus-visible {
  outline: 2px solid var(--color-neutral-border-focused);
  outline-offset: 2px;
}

.fund-pill:active {
  transform: scale(0.96);
}

.fund-pill[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  z-index: 20;
  padding: 0.3rem 0.5rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  font-family: var(--type-line-small-medium-font-family);
  font-size: var(--type-line-small-medium-font-size);
  font-weight: var(--type-line-small-medium-font-weight);
  line-height: var(--type-line-small-medium-line-height);
  color: var(--color-neutral-text-primary);
  background-color: var(--color-neutral-background-primary);
  border: 1px solid var(--color-neutral-border-primary);
  box-shadow: 0 4px 16px var(--color-helper-alpha-overlay);
  opacity: 0;
  transform: translateX(-50%) translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.fund-pill[data-tooltip]:hover::after,
.fund-pill[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fund-pill__icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.fund-pill__icon path {
  stroke: currentColor;
}

.fund-pill__label {
  font-family: var(--type-line-small-medium-font-family);
  font-size: var(--type-line-small-medium-font-size);
  font-weight: var(--type-line-small-medium-font-weight);
  line-height: var(--type-line-small-medium-line-height);
  letter-spacing: var(--type-line-small-medium-letter-spacing);
  color: currentColor;
  white-space: nowrap;
}

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

/* -------------------------------------------------------------------------- */
/* Small screens: full-width cards; dock may scroll horizontally if needed    */
/* -------------------------------------------------------------------------- */

@media (max-width: 48rem) {
  .home-quick-card {
    max-width: 100%;
  }

  .dock__pill {
    max-width: calc(100vw - 2rem);
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

}
