.history-drawer > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}
.history-drawer > summary::-webkit-details-marker { display: none; }
.history-drawer > summary::after { content: '+'; color: #9a412f; }
.history-drawer[open] > summary::after { content: '−'; }
.history-drawer-content { padding-top: 12px; }
.history-drawer summary:focus-visible { outline: 3px solid #1260a2; outline-offset: 3px; }
.request-review-shell {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
  color: var(--ink);
  margin-top: 14px;
  min-width: 0;
  box-shadow: 0 4px 14px #24231f08;
}
.request-review-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: #292823;
  color: #fff;
  flex: 0 0 auto;
}
.request-review-header h2 { margin: 0; font-size: 15px; line-height: 1.45; }
.request-review-header form { margin: 0; flex: 0 0 auto; }
.request-review-header button {
  color: #fff;
  border-color: #777168;
  background: transparent;
  padding: 5px 9px;
  font-size: 11px;
  min-height: 36px;
}
.request-review-body { padding: 17px; display: grid; gap: 15px; align-content: start; }
.request-review-body p, .request-review-body form, .request-review-body h3 { margin: 0; }
.request-review-body h3 { font-size: 17px; line-height: 1.4; }
.review-reference { display: grid; gap: 6px; overflow-wrap: anywhere; }
.review-reference h3 { font-size: 16px; }
.review-resource-type { color: var(--muted); font-size: 11px; font-weight: 700; }
.review-reference p { font-size: 12px; color: var(--muted); }
.review-metadata > summary, .review-terms > summary { cursor: pointer; color: #205458; font-size: 12px; font-weight: 700; }
.review-metadata dl { margin: 10px 0; font-size: 12px; }
.review-metadata dl > div { grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.review-metadata dd { overflow-wrap: anywhere; }
.review-metadata button { padding: 7px 10px; min-height: 36px; font-size: 12px; }
.review-access { background: #edf5f4; border-radius: 8px; padding: 12px; display: grid; gap: 7px; font-size: 12px; color: #205458; }
.review-access-open { background: #edf5e9; color: #315934; }
.review-access-warning { background: #fff2dc; color: #765415; }
.review-access .access-options { width: 100%; display: grid; gap: 8px; }
.review-access .button, .review-access .access-link { width: 100%; max-width: 100%; min-height: 40px; height: auto; flex: 1 1 auto; margin: 0; font-size: 11px; padding: 8px; }
.candidate-citation .review-access .catalog-access-link,
.request-review-shell .review-access .catalog-access-link,
.candidate-citation .access-link.catalog-access-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: fit-content; max-width: 100%; min-height: 46px; padding: 11px 18px;
  font-size: 16px; font-weight: 700; line-height: 1.4; text-align: center;
  color: #205458; background: #fff; border: 1px solid #527f82; border-radius: 8px;
  text-decoration: none; white-space: normal;
}
.catalog-access-link:hover { background: #e2efee; }
.catalog-access-link:focus-visible { outline: 3px solid #1260a2; outline-offset: 3px; }
.review-request { display: grid; gap: 13px; border-top: 1px solid var(--line); padding-top: 14px; }
.review-delivery { font-size: 12px; color: var(--muted); }
.review-delivery strong { color: var(--ink); }
.review-terms { padding-top: 10px; border-top: 1px solid var(--line); }
.review-terms p { margin-top: 8px; font-size: 12px; overflow-wrap: anywhere; }
.review-checks { gap: 12px; }
.review-checks label { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.5; }
.review-checks .chapter-pages { display: grid; gap: 7px; font-weight: 600; }
.review-checks .chapter-pages input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px; font-size: 16px; border: 1px solid #708f90; border-radius: 7px; }
.review-checks .chapter-pages small { color: var(--muted); font-size: 12px; font-weight: 400; }
.review-checks input[type='checkbox'] { width: 17px; height: 17px; flex: 0 0 17px; margin: 2px 0 0; accent-color: #205458; }
.review-checks button, .request-review-body > form button { width: 100%; font-size: 13px; font-weight: 700; }
.review-checks button:disabled { background: #f4d4c7; border-color: #f4d4c7; color: #654035; cursor: default; }
.review-fields { display: grid; grid-template-columns: minmax(0, 1fr); font-size: 12px; }
.review-fields input, .review-fields select { min-height: 42px; padding: 8px; }
.review-fields > label, .review-fields .field-wide, .review-fields > .primary { grid-column: 1; }
.review-intro { font-size: 12px; color: var(--muted); }
.review-submit-status { color: #205458; font-size: 12px; padding-top: 8px; }
form[aria-busy='true'] button { pointer-events: none; }
.candidate.review-selected { border-color: #ce8b78; box-shadow: inset 3px 0 0 #dd7259; }
html.review-restoring { scroll-behavior: auto; }
@media (min-width: 1101px) {
  .app-layout.has-request-review { grid-template-columns: minmax(0, 1fr) 350px; }
  .app-layout.has-request-review.has-result-facets {
    grid-template-columns: 190px minmax(0, 1fr) 350px;
    grid-template-areas: 'search search history' 'quick quick history' 'facets results history';
    gap: 0 22px;
  }
  .app-layout.has-request-review > .request-sidebar { padding-left: 18px; align-self: stretch; }
  .request-sidebar > .request-review-shell { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100dvh - 90px); }
  .request-sidebar > .request-review-shell .request-review-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .request-review-shell.is-inline { max-width: 850px; }
}
@media (max-width: 1100px) {
  .request-review-shell.is-sidebar {
    position: fixed;
    inset: 0;
    width: 100%;
    height: var(--review-mobile-height, 100dvh);
    max-height: var(--review-mobile-height, 100dvh);
    z-index: 1500;
    margin: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  .request-review-shell.is-sidebar .request-review-body { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px max(24px, env(safe-area-inset-bottom)); }
  .request-review-shell.is-sidebar .request-review-header { padding-top: max(14px, env(safe-area-inset-top)); }
  .request-review-header button { min-height: 44px; padding: 8px 12px; }
  html.request-review-mobile, html.request-review-mobile body { overflow: hidden; }
  html.request-review-mobile [data-crai-widget] { visibility: hidden; }
  .review-fields input, .review-fields select { font-size: 16px; }
}

/* Each result is a reference/request pair; history occupies only the upper row. */
.app-layout { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: 'search history' 'quick quick' 'results results'; }
.app-layout.has-result-facets { grid-template-columns: 200px minmax(0, 1fr) 300px; grid-template-areas: 'search search history' 'quick quick quick' 'facets results results'; gap: 0 24px; }
.app-layout > .history-sidebar { align-self: start; padding: 0; border: 0; max-height: 360px; overflow: hidden; }
.history-drawer-content { padding: 6px 10px 8px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 9px 9px; background: #fff; }
.history-sidebar .history-drawer-content {
  box-sizing: border-box;
  max-height: calc(300px - var(--history-summary-height, 48px));
  overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain;
  scrollbar-width: auto; scrollbar-gutter: stable;
}
.history-drawer-content:focus-visible { outline: 2px solid #205458; outline-offset: -2px; }
.history-sidebar .history-intro { font-size: 11px; margin: 3px 0 6px; }
.history-tools > summary { font-size: 11px; cursor: pointer; color: #205458; padding: 4px 0; }
.history-tools { margin-bottom: 4px; }
.history-sidebar .history-item { display: flex; align-items: center; gap: 5px; padding: 6px 0; margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.history-sidebar .history-link { flex: 1; min-width: 0; margin: 0; }
.history-sidebar .history-link button { display: block; min-height: 36px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.history-sidebar .history-link button > small:first-child { display: none; }
.history-sidebar .history-link p { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; margin: 0; line-height: 1.45; }
.history-sidebar .history-status { display: block; font-size: 10px; white-space: normal; overflow-wrap: anywhere; padding: 0; line-height: 1.4; }
.history-sidebar .status-checked { display: block; font-size: 10px; line-height: 1.4; padding-top: 3px; }
.history-sidebar .history-visibility { position: static; flex: 0 0 auto; margin: 0; }
.history-sidebar .history-visibility button { font-size: 10px; min-height: 32px; padding: 4px 6px; }
.history-sidebar .history-more { margin: 4px 0 0; padding-top: 4px; }
.history-sidebar .history-more > summary { padding: 7px; min-height: 32px; font-size: 11px; }
.results .candidate { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: stretch; gap: 18px; padding: 0; margin: 18px 0 24px; border: 0; background: transparent; box-shadow: none; }
.candidate-citation, .candidate-request-slot { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.candidate-citation { padding: 22px; }
.candidate-citation h3 { margin: 9px 0 13px; font-size: 20px; line-height: 1.4; }
.candidate-kind { color: var(--muted); font-size: 12px; font-weight: 600; margin: 0; }
.candidate-citation > p:not(.candidate-kind) { font-size: 13px; margin: 10px 0 16px; }
.candidate-citation .candidate-details-line { overflow-wrap: anywhere; }
.candidate-metadata { border-top: 1px solid var(--line); padding-top: 13px; margin: 16px 0; }
.candidate-metadata > summary { cursor: pointer; color: #205458; font-size: 12px; font-weight: 700; }
.candidate-abstract { margin: 14px 0; border-top: 1px solid var(--line); padding-top: 12px; }
.candidate-abstract > summary { cursor: pointer; color: #205458; font-size: 14px; font-weight: 700; }
.abstract-body { padding-top: 10px; min-width: 0; }
.abstract-preview, .abstract-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; color: var(--ink); }
.abstract-text { max-height: 16rem; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding-right: 8px; }
.abstract-more > summary { cursor: pointer; color: #205458; font-size: 13px; font-weight: 700; padding: 8px 0; min-height: 36px; }
.abstract-more .abstract-show-less { display: none; }
.abstract-more[open] .abstract-show-more { display: none; }
.abstract-more[open] .abstract-show-less { display: inline; }
.abstract-body:has(> .abstract-more[open]) > .abstract-preview { display: none; }
.candidate-abstract summary:focus-visible, .abstract-full:focus-visible { outline: 2px solid #205458; outline-offset: 2px; }
.candidate-metadata .muted { overflow-wrap: anywhere; font-size: 12px; }
.access-available, .review-access { padding-inline: 15px; }
.review-access { border-inline: 1px solid transparent; }
.access-available { flex-direction: column; align-items: stretch; }
.candidate-citation .access-available { padding-block: 15px; }
.candidate-citation .access-available p { font-size: 12px; }
.access-available .access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  flex: 0 1 auto;
  justify-content: stretch;
}
:is(.access-available .button.access-link, .review-access > .button.catalog-access-link) {
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 48px;
  padding-block: 8px;
  line-height: 1.35;
}
.review-access > .button.catalog-access-link {
  white-space: normal;
  overflow-wrap: anywhere;
}
.access-available .button.access-link { padding-inline: clamp(6px, 2%, 12px); gap: clamp(4px, 1%, 8px); }
.access-available .access-link:only-of-type, .unpaywall-access-credit { grid-column: 1 / -1; }
.candidate-citation .no-request { font-size: 12px; }
.candidate-citation .save-reference { margin: 14px 0 0; }
.results .candidate-request-slot { display: block; align-self: start; overflow: hidden; padding: 0; }
.candidate-citation .save-reference button { background: #e8f2f2; color: #205458; border-color: #79a4a8; font-weight: 600; }
.result-request-card { padding: 20px; }
.result-request-card h4 { font-size: 20px; line-height: 1.35; margin: 12px 0; }
.result-request-card p { font-size: 12px; line-height: 1.6; margin: 10px 0; }
.result-request-card .request-service { color: var(--muted); font-size: 11px; font-weight: 600; margin: 0; }
.result-request-card .request-delivery { margin: 16px 0; padding: 13px 0; border-block: 1px solid var(--line); color: var(--muted); }
.request-delivery strong { display: block; color: var(--ink); }
.result-request-card .review-terms { border-top: 0; padding: 0; margin: 14px 0; }
.result-request-card .checks { margin-top: 14px; }
.result-request-card button { width: 100%; min-height: 44px; }
.candidate-request-slot .is-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.is-card .request-review-header { color: #205458; background: #edf5f4; padding: 10px 14px; }
.is-card .request-review-header h2 { font-size: 12px; }
.is-card .request-review-header button { color: #205458; background: #fff; border-color: #b5ccca; font-size: 11px; }
.is-card .request-review-body { padding: 20px; }
.is-card .review-request { border: 0; padding: 0; }
.is-card .review-request h3 { font-size: 20px; }
.is-card .review-delivery { border-block: 1px solid var(--line); padding: 12px 0; }
.candidate.review-selected .candidate-citation { border-color: #ce8b78; box-shadow: inset 3px 0 0 #dd7259; }
.candidate.review-selected { box-shadow: none; }
.candidate [data-request-panel] { scroll-margin-top: 18px; }
@media (max-width: 1100px) {
  .app-layout, .app-layout.has-result-facets { grid-template-columns: 180px minmax(0, 1fr); grid-template-areas: 'history history' 'search search' 'quick quick' 'facets results'; gap: 0 18px; }
  .app-layout:not(.has-result-facets) { grid-template-areas: 'history history' 'search search' 'quick quick' 'results results'; }
  .app-layout > .history-sidebar { width: 100%; max-height: 300px; margin: 0 0 16px; }
  .results .candidate { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .history-drawer-content { padding-inline: 14px; }
}
@media (max-width: 720px) {
  .app-layout, .app-layout.has-result-facets { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'history' 'search' 'quick' 'facets' 'results'; }
  .candidate-citation, .result-request-card, .is-card .request-review-body { padding: 18px; }
  .candidate-citation h3 { font-size: 19px; }
  .history-sidebar .history-visibility button { min-height: 40px; }
  .history-sidebar .history-link button { min-height: 40px; }
  .history-drawer > summary { min-height: 44px; align-items: center; }
}

@media (min-width: 1101px) {
  .app-layout > .history-sidebar {
    height: var(--history-available-height, 740px);
    max-height: none;
    overflow: hidden;
  }
  .history-drawer[open] { height: 100%; display: flex; flex-direction: column; }
  .history-drawer > summary { flex: 0 0 auto; }
  .history-sidebar .history-drawer-content {
    min-height: 0; flex: 1;
    height: calc(var(--history-available-height, 740px) - var(--history-summary-height, 48px));
    max-height: calc(var(--history-available-height, 740px) - var(--history-summary-height, 48px));
  }
}
