/* Final UI readability layer for the academic workspace. Loaded last on purpose. */
.academic-index-page .ad-flow-command > .ad-literature-tools {
  min-height: 72px;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 104px 76px;
  overflow: hidden;
  border-radius: 14px;
}

.academic-index-page .ad-flow-command > .ad-literature-tools label {
  position: relative;
  display: flex;
  min-height: 70px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 12px 6px;
  text-align: center;
}

.academic-index-page .ad-literature-filter-label {
  display: inline-flex;
  min-height: 18px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #687f9f;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  align-self: center !important;
}

.academic-index-page .ad-literature-filter-label > img {
  width: 15px;
  height: 15px;
}

.academic-index-page .ad-flow-command > .ad-literature-tools label > select {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 24px 0 8px;
  color: #17355f;
  font-size: 12.5px;
  font-weight: 720;
  line-height: 26px;
  text-align: left;
  text-align-last: left;
  border-radius: 8px !important;
  align-self: center !important;
}

.academic-index-page .ad-flow-command > .ad-literature-tools label > select option { text-align: left; }

.academic-index-page .ad-flow-command > .ad-literature-tools label > select.ad-motion-select-native {
  position: relative;
  z-index: 2;
  cursor: pointer;
  color: transparent !important;
  background: transparent !important;
  opacity: 1 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.academic-index-page .ad-flow-command > .ad-literature-tools label > select.ad-motion-select-native option {
  color: #17355f;
  background: #fff;
}

.academic-index-page .ad-motion-select-value {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 6px;
  left: 12px;
  display: flex;
  height: 26px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 7px 0 8px;
  color: #17355f;
  font-size: 12.5px;
  font-weight: 720;
  line-height: 26px;
  pointer-events: none;
}

.academic-index-page .ad-motion-select-viewport {
  display: block;
  min-width: 0;
  max-width: calc(100% - 29px);
  flex: 0 1 auto;
  overflow: hidden;
  text-align: left;
}

.academic-index-page .ad-motion-select-track {
  display: inline-block;
  min-width: max-content;
  white-space: nowrap;
  will-change: transform;
}

.academic-index-page .ad-motion-select-value > img {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.academic-index-page .ad-motion-select-value.is-overflowing .ad-motion-select-track {
  animation: ad-select-pingpong var(--ad-select-duration, 5s) ease-in-out infinite;
}

.academic-index-page .ad-flow-command > .ad-literature-tools label:has(select:focus-visible) .ad-motion-select-value {
  border-radius: 7px;
  box-shadow: 0 0 0 2px rgba(42, 108, 230, .2);
}

@keyframes ad-select-pingpong {
  0%, 18% { transform: translateX(0); }
  72%, 88% { transform: translateX(var(--ad-select-shift, 0)); }
  100% { transform: translateX(0); }
}

.academic-index-page .ad-literature::before { display: none; }

.academic-index-page .ad-paper-grid {
  position: relative;
}

.academic-index-page .ad-paper-grid::before {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 18px;
  width: 1px;
  content: "";
  background: linear-gradient(180deg, rgba(45, 113, 221, .25), rgba(45, 113, 221, .08));
}

.academic-index-page .ad-filter-result-count,
.academic-index-page .ad-filter-reset {
  min-height: 70px;
  justify-content: center;
}

.academic-index-page .ad-filter-result-count {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-inline: 12px;
  font-size: 12px;
}

.academic-index-page .ad-filter-result-count strong { font-size: 14px; }
.academic-index-page .ad-filter-reset { font-size: 12px; }

.academic-index-page .ad-citation-dialog[open] {
  width: min(calc(100vw - 48px), clamp(800px, 52vw, 940px));
  max-height: min(84vh, 780px);
}

.academic-index-page .ad-citation-dialog [data-ap-citation-content] { padding: 30px 32px 28px; }
.academic-index-page .ad-citation-head { padding: 0 52px 19px 0; }
.academic-index-page .ad-citation-head .rh-eyebrow { font-size: 10.5px; letter-spacing: .16em; }
.academic-index-page .ad-citation-head h2 { margin-top: 5px; font-size: clamp(29px, 2vw, 34px); }
.academic-index-page .ad-citation-head > div > p:last-child { margin-top: 8px; color: #4f698b; font-size: 12.5px; line-height: 1.6; }
.academic-index-page .ad-citation-head > span { padding: 7px 12px; font-size: 11px; font-weight: 720; }
.academic-index-page .ad-citation-record { gap: 6px; margin-top: 18px; padding: 17px 19px; border-radius: 13px; }
.academic-index-page .ad-citation-record span { color: #4f6c94; font-size: 11px; font-weight: 650; }
.academic-index-page .ad-citation-record strong { font-size: clamp(17px, 1.2vw, 20px); line-height: 1.45; }
.academic-index-page .ad-citation-record small { color: #526c8f; font-size: 12.25px; line-height: 1.55; }
.academic-index-page .ad-citation-integrity { gap: 10px 17px; margin: 14px 0; }
.academic-index-page .ad-citation-integrity span { color: #4d6688; font-size: 11.25px; font-weight: 580; }
.academic-index-page .ad-citation-integrity i { width: 8px; height: 8px; }
.academic-index-page .ad-citation-integrity [data-state="online"] i { background: #4d86da; }
.academic-index-page .ad-citation-formats { padding: 5px; border-radius: 12px; }
.academic-index-page .ad-citation-formats button { min-height: 39px; padding: 0 17px; font-size: 12.25px; font-weight: 680; }
.academic-index-page .ad-citation-preview { margin-top: 12px; }
.academic-index-page .ad-citation-preview > div { min-height: 45px; padding: 0 16px; }
.academic-index-page .ad-citation-preview > div strong { font-size: 12.25px; }
.academic-index-page .ad-citation-preview > div button { min-height: 32px; padding: 0 11px; font-size: 11.25px; font-weight: 650; }
.academic-index-page .ad-citation-preview pre {
  min-height: 126px;
  max-height: 230px;
  padding: 17px;
  color: #17345b;
  font: 12.25px/1.72 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
.academic-index-page .ad-citation-actions { gap: 9px; margin-top: 12px; }
.academic-index-page .ad-citation-actions button,
.academic-index-page .ad-citation-actions button:nth-last-child(-n + 3) {
  min-height: 43px;
  padding-inline: 12px;
  border-radius: 10px;
  font-size: 12.25px;
  font-weight: 680;
}
.academic-index-page .ad-citation-actions img { width: 15px; height: 15px; }

.academic-index-page .ad-dialog > .ad-dialog-close,
.academic-index-page .ad-citation-formats button,
.academic-index-page .ad-citation-preview > div button,
.academic-index-page .ad-citation-actions button,
.academic-index-page .ad-paper-saved-list a,
.academic-index-page .ad-paper-saved-list button,
.academic-index-page .ad-paper-workspace-footer button {
  border-radius: 10px !important;
}

.academic-index-page .ad-compare-dialog[open]:has(.ad-paper-workspace-head) {
  width: min(calc(100vw - 48px), 940px);
  max-height: min(84vh, 780px);
}

.academic-index-page .ad-compare-dialog [data-ad-compare-content]:has(.ad-paper-workspace-head) { padding: 30px 32px 28px; }
.academic-index-page .ad-compare-dialog .ad-paper-workspace-head { padding-right: 52px; }
.academic-index-page .ad-compare-dialog .ad-paper-workspace-head .rh-eyebrow { margin-bottom: 7px; font-size: 10.5px; letter-spacing: .16em; }
.academic-index-page .ad-compare-dialog .ad-paper-workspace-head h2 { font-size: clamp(28px, 2vw, 33px); line-height: 1.2; }
.academic-index-page .ad-compare-dialog .ad-paper-workspace-head > p:last-child { margin-top: 8px; color: #506b8e; font-size: 12.5px; line-height: 1.6; }
.academic-index-page .ad-paper-saved-list { gap: 10px; margin-top: 22px; }
.academic-index-page .ad-paper-saved-list article { gap: 20px; padding: 17px 18px; border-radius: 14px; background: #f9fbfe; }
.academic-index-page .ad-paper-saved-list small { color: #516f98; font-size: 11px; }
.academic-index-page .ad-paper-saved-list h3 { margin: 6px 0; font-size: 16px; line-height: 1.45; }
.academic-index-page .ad-paper-saved-list p { color: #526b8b; font-size: 12px; line-height: 1.5; }
.academic-index-page .ad-paper-saved-list article > div:last-child { gap: 8px; }
.academic-index-page .ad-paper-saved-list a,
.academic-index-page .ad-paper-saved-list button,
.academic-index-page .ad-paper-workspace-footer button {
  min-height: 39px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}
.academic-index-page .ad-paper-workspace-footer { margin-top: 18px; }
.academic-index-page .ad-paper-workspace-footer span { color: #536d91; font-size: 12px; }
.academic-index-page .ad-paper-workspace-empty h3 { font-size: 17px; }
.academic-index-page .ad-paper-workspace-empty p { color: #526d91; font-size: 12.5px; line-height: 1.6; }
.academic-index-page .ad-paper-compare-grid article { padding: 17px; }
.academic-index-page .ad-paper-compare-grid article > small { font-size: 11px; }
.academic-index-page .ad-paper-compare-grid h3 { font-size: 16px; line-height: 1.45; }
.academic-index-page .ad-paper-compare-grid dt { font-size: 10.5px; font-weight: 650; }
.academic-index-page .ad-paper-compare-grid dd { font-size: 12px; line-height: 1.62; }
.academic-index-page .ad-paper-compare-grid article > a { font-size: 12px; font-weight: 650; }

.academic-index-page .ro-backtop {
  width: 52px;
  height: 52px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 50% !important;
  background: linear-gradient(145deg, #1b6380, #123f5a);
  box-shadow: 0 14px 34px rgba(17, 64, 91, .28), 0 0 0 5px rgba(255, 255, 255, .72);
  transition: transform .24s cubic-bezier(.2, .8, .2, 1), box-shadow .24s ease, background .24s ease;
  bottom: calc(22px + env(safe-area-inset-bottom) + var(--ad-floating-footer-lift, 0px));
}

.academic-index-page .ad-paper-workspace-tools,
.academic-index-page .ad-paper-workspace-tools:hover {
  bottom: calc(82px + env(safe-area-inset-bottom) + var(--ad-floating-footer-lift, 0px));
}

@media (min-width: 981px) {
  .academic-index-page.ro-native-academic-scroll .ad-index-sidebar {
    position: sticky !important;
    top: 10px !important;
    align-self: start;
    max-height: calc(100vh - 20px) !important;
    overflow: hidden auto !important;
    overscroll-behavior: contain;
    transform: translateY(var(--ad-sidebar-end-shift, 0px));
    transition: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .academic-index-page.ro-native-academic-scroll:has(.site-header:not(.is-header-hidden)) .ad-index-sidebar {
    top: 72px !important;
    max-height: calc(100vh - 82px) !important;
  }

  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools,
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools:hover {
    position: static !important;
    display: grid;
    width: auto;
    margin: 12px 9px 0;
    padding: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    border: 1px solid #dbe6f4;
    border-radius: 14px !important;
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(244, 249, 255, .96));
    box-shadow: 0 10px 24px rgba(34, 75, 133, .08);
    transform: none;
  }

  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button,
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button:hover,
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button:focus-visible {
    width: auto;
    min-height: 48px;
    padding: 0 8px;
    grid-template-columns: 16px minmax(0, 1fr) 20px;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 10px !important;
    background: transparent;
  }

  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button:hover,
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button:focus-visible {
    border-color: #c8d9f0;
    background: #fff;
    box-shadow: 0 6px 14px rgba(31, 77, 142, .09);
  }

  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools span,
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button:hover span,
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools > button:focus-visible span {
    display: grid;
    max-width: none;
    gap: 2px;
    opacity: 1;
    text-align: left;
  }

  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools strong { font-size: 10.5px; }
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools small { display: none; }
  .academic-index-page .ad-index-sidebar .ad-paper-workspace-tools b { width: 20px; height: 20px; }

}

.academic-index-page .ro-backtop:hover,
.academic-index-page .ro-backtop:focus-visible {
  outline: none;
  background: linear-gradient(145deg, #247a97, #154963);
  box-shadow: 0 18px 40px rgba(17, 64, 91, .34), 0 0 0 5px rgba(235, 247, 249, .94);
  transform: translateY(-5px);
}

.academic-index-page .ro-backtop img { width: 19px; height: 19px; }
.academic-index-page .ro-backtop:hover img,
.academic-index-page .ro-backtop:focus-visible img { animation: ad-backtop-rise .72s cubic-bezier(.22, .8, .28, 1) infinite; }

.academic-index-page .ad-paper-workspace-tools,
.academic-index-page .ad-paper-workspace-tools:hover { border-radius: 18px !important; }
.academic-index-page .ad-paper-workspace-tools > button,
.academic-index-page .ad-paper-workspace-tools > button:hover,
.academic-index-page .ad-paper-workspace-tools > button:focus-visible { border-radius: 12px !important; }

@keyframes ad-backtop-rise {
  0% { transform: rotate(-90deg) translateX(2px); opacity: .7; }
  55% { transform: rotate(-90deg) translateX(7px); opacity: 1; }
  100% { transform: rotate(-90deg) translateX(2px); opacity: .7; }
}

@media (max-width: 980px) {
  .academic-index-page .ad-flow-command > .ad-literature-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .academic-index-page .ad-filter-result-count,
  .academic-index-page .ad-filter-reset { min-height: 48px; }
}

@media (max-width: 760px) {
  .academic-index-page .ad-citation-dialog[open],
  .academic-index-page .ad-compare-dialog[open]:has(.ad-paper-workspace-head) { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .academic-index-page .ad-citation-dialog [data-ap-citation-content],
  .academic-index-page .ad-compare-dialog [data-ad-compare-content]:has(.ad-paper-workspace-head) { padding: 50px 16px 18px; }
  .academic-index-page .ad-citation-head h2,
  .academic-index-page .ad-compare-dialog .ad-paper-workspace-head h2 { font-size: 26px; }
  .academic-index-page .ad-citation-preview pre { font-size: 11.5px; }
  .academic-index-page .ad-paper-saved-list article { grid-template-columns: 1fr; }
  .academic-index-page .ro-backtop { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .academic-index-page .ad-motion-select-value.is-overflowing .ad-motion-select-track { animation: none; }
  .academic-index-page .ro-backtop:hover img,
  .academic-index-page .ro-backtop:focus-visible img { animation: none; }
}

/* Mobile interaction pass: the example chips are real search actions, so keep
   their tap area comfortably larger than the compact desktop presentation. */
@media (max-width: 760px) {
  .academic-index-page .ad-index-search-fields button:not(.ad-advanced-search-toggle) {
    min-height: 36px;
    padding-inline: 11px;
  }
}

/* Verified literature cards: titles are primary links and unverified imagery does not occupy space. */
.academic-index-page .ad-feature-paper-title {
  width: 100%;
  min-width: 0;
  margin: 0;
  font: inherit;
  text-wrap: auto;
}

.academic-index-page .ad-feature-paper-title > a,
.academic-index-page .ad-feature-paper-summary > strong > a {
  width: 100%;
  display: -webkit-box;
  overflow: hidden;
  color: #102b59;
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: 735;
  line-height: 1.42;
  letter-spacing: -.012em;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* The record has six real actions. A seven-column legacy grid left a visible
   empty cell and gave browser-injected journal helpers room to appear as stray
   logo-only rows. Keep only the six owned controls. */
.academic-index-page .ad-paper-record .ad-nebula-preview-actions {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.academic-index-page .ad-paper-record .ad-feature-paper-summary > :not(.ad-feature-paper-meta):not(.ad-feature-paper-title):not(small):not(.ad-feature-institutions):not(.ad-feature-accesses),
.academic-index-page .ad-paper-record .ad-nebula-preview-actions > :not(a):not(button),
.academic-index-page .ad-paper-record .ad-nebula-preview-actions > a:not([data-ap-open]) {
  display: none !important;
}

.academic-index-page .ad-feature-paper-title > a:hover,
.academic-index-page .ad-feature-paper-title > a:focus-visible,
.academic-index-page .ad-feature-paper-summary > strong > a:hover,
.academic-index-page .ad-feature-paper-summary > strong > a:focus-visible {
  color: #075dcc;
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.academic-index-page .ad-paper-record .ad-feature-paper-heading.has-no-visual {
  min-height: 0;
  grid-template-columns: 72px minmax(0, 1fr);
}

.academic-index-page .ad-paper-record .ad-feature-abstract-preview.is-pending {
  border-color: #e2e9f2;
  color: #657b9a;
  background: #fafcff;
  cursor: default;
}

.academic-index-page .ad-paper-record .ad-feature-abstract-preview.is-pending:hover {
  border-color: #e2e9f2;
  background: #fafcff;
}

/* The abstract is supporting content, not a second card inside every record. */
.academic-index-page .ad-paper-record .ad-feature-abstract-preview,
.academic-index-page .ad-paper-record .ad-feature-abstract-preview.is-pending {
  min-height: 0;
  padding: 9px 0 8px;
  border: 0;
  border-top: 1px solid #e6edf6;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1.62;
}

.academic-index-page .ad-paper-record .ad-feature-abstract-preview:hover,
.academic-index-page .ad-paper-record .ad-feature-abstract-preview:focus-visible,
.academic-index-page .ad-paper-record .ad-feature-abstract-preview[aria-expanded="true"],
.academic-index-page .ad-paper-record .ad-feature-abstract-preview.is-pending:hover {
  border-color: #d6e2f1;
  outline: none;
  background: linear-gradient(90deg, rgba(245, 249, 255, .9), rgba(255, 255, 255, 0));
}

.academic-index-page .ad-paper-record .ad-feature-abstract-preview strong {
  white-space: nowrap;
}

.academic-index-page .ad-paper-record .ad-feature-paper-heading {
  min-height: 0;
}

.academic-index-page .ad-paper-record .ad-paper-visual.is-card-visual {
  align-self: start;
}

.academic-index-page .ad-nebula-preview .ad-feature-expand-state {
  border: 0;
  background: transparent;
}

.academic-index-page .ad-index-search-fields {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.academic-index-page .ad-index-search-fields::-webkit-scrollbar { display: none; }

.academic-index-page .ro-backtop { display: none !important; }

/* Keep the pager visually connected to the site footer without a blank stage. */
.academic-index-page .ad-index-desk { padding-bottom: 18px; }
.academic-index-page .academic-discovery-main { padding-bottom: 8px; }

@media (max-width: 1180px) and (min-width: 981px) {
  .academic-index-page .ad-index-desk { padding-bottom: 18px; }
  .academic-index-page .academic-discovery-main { padding-bottom: 8px; }

  .academic-index-page .ad-paper-record .ad-feature-paper-heading.has-no-visual {
    grid-template-columns: 60px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .academic-index-page .ad-index-desk { padding-bottom: 16px; }
  .academic-index-page .academic-discovery-main { padding-bottom: 6px; }

  .academic-index-page .ad-index-heading { min-height: 166px; }

  .academic-index-page .ad-index-heading-copy { width: 100%; }

  .academic-index-page .ad-index-heading h1 { white-space: nowrap; }

  .academic-index-page .ad-index-heading-copy > p:not(.ad-index-eyebrow) {
    width: calc(100vw - 56px);
    max-width: none;
    overflow: visible;
    white-space: normal;
  }

  .academic-index-page .ad-paper-record .ad-feature-paper-heading.has-no-visual {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .academic-index-page .ad-paper-record .ad-nebula-preview-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .academic-index-page .ad-paper-workspace-tools,
  .academic-index-page .ad-paper-workspace-tools:hover {
    right: 76px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    width: auto;
    padding: 5px;
    flex-direction: row;
    gap: 4px;
    border-radius: 14px !important;
  }

  .academic-index-page .ad-paper-workspace-tools > button,
  .academic-index-page .ad-paper-workspace-tools > button:hover,
  .academic-index-page .ad-paper-workspace-tools > button:focus-visible {
    width: auto;
    min-width: 0;
    min-height: 44px;
    flex: 1 1 0;
    grid-template-columns: 16px minmax(0, 1fr) 19px;
    gap: 6px;
    padding: 0 8px;
  }

  .academic-index-page .ad-paper-workspace-tools span,
  .academic-index-page .ad-paper-workspace-tools > button:hover span,
  .academic-index-page .ad-paper-workspace-tools > button:focus-visible span {
    display: grid;
    max-width: none;
    opacity: 1;
    text-align: left;
  }

  .academic-index-page .ad-paper-workspace-tools strong { font-size: 10px; }
  .academic-index-page .ad-paper-workspace-tools small { display: none; }
}
