/* Online research workspace. Pricing and paper-access panels keep their own styles. */
:root { --bg: #f2f5f9; --panel: #f8fafc; --line: #d5dfeb; --muted: #526476; --red: #ca3340; --green: #167341; }
.shell { grid-template-columns: minmax(252px, 282px) minmax(0, 1fr); }
aside { padding: 24px 18px; }
main { width: 100%; max-width: 1520px; margin-inline: auto; padding: 24px clamp(16px, 2.3vw, 38px); }
@media (min-width: 1920px) {
  main { max-width: 2400px; }
}
.workspace-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.workspace-brand img { flex: 0 0 auto; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
.brand { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -.035em; }
.brand span { font-size: 14px; letter-spacing: 0; color: #48627b; }
.version { margin: 3px 0 0; font-size: 12px; }
.rail-panel { border: 0; border-top: 1px solid var(--line); background: transparent; padding: 10px 0 0; margin: 12px 0 0; border-radius: 0; }
.rail-panel > summary { padding: 7px 0; font-size: 16px; }
.rail-panel[open] > summary { margin-bottom: 6px; }
.rail-panel input[type=email] { width: 100%; padding: 9px 11px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.rail-panel form button { font-size: 13px; }
.rail-panel .tiny { overflow-wrap: anywhere; }
.rail-panel .btn-row { gap: 6px; }
.rail-panel .btn-row > * { padding: 8px 10px; font-size: 13px; }
.rail-panel .selection-help { padding: 0; margin: 1px 0; }
.rail-panel button[data-requires-selection]:disabled { background: #edf0f5; color: #637286; border-color: #d6dee9; cursor: not-allowed; }
.selected-counter, .result-count { display: inline-block; padding: 3px 9px; font-size: 12px; border-radius: 20px; font-weight: 700; font-variant-numeric: tabular-nums; background: #e8effa; color: #305485; }
.card, .paper-card { border-color: var(--line); border-radius: 14px; box-shadow: 0 2px 7px rgba(24, 46, 70, .045); }
.card { margin-bottom: 14px; padding: 18px 20px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.workspace-heading h1, .workspace-heading h2 { margin: 0; color: #182d42; letter-spacing: -.035em; font-weight: 730; }
.workspace-heading h1 { font-size: clamp(25px, 2.4vw, 34px); }
.workspace-heading h2 { font-size: 23px; }
.workspace-heading a, .selection-toolbar a, .queue-link { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.search-topic label { font-size: 14px; font-weight: 700; }
#query { border-color: #a8bbcd; background: #fcfdff; }
.search-advanced { padding-top: 6px; margin-top: 11px; }
.search-advanced > summary { padding: 7px 0; }
.search-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search-actions > *, .btn-ultra { min-height: 44px; }
.search-actions button:disabled { background: #edf0f5 !important; color: #637286 !important; border-color: #d6dee9 !important; }
.ultra-search-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-top: 12px; border-top: 1px solid #e3e9f0; }
.btn-ultra { width: auto; min-height: 36px; padding: 6px 12px; background: #fff7f9; color: #863454; border-color: #dfb8c7; font-size: 14px; box-shadow: none; }
.ultra-search-release { font-size: 10px; background: #f1dce6; color: #773451; border: 0; }
.ultra-search-access { margin: 0; font-weight: 600; }
.workspace-access .notice { margin: 0 0 14px; padding: 9px 13px; font-size: 13px; line-height: 1.5; }
.workspace-matrix { margin-top: 0; padding-block: 11px; }
.workspace-matrix > summary { padding-block: 5px; }
.matrix-title { font-size: 17px; font-weight: 730; }
.matrix-title-sub { display: inline-block; margin: 0 0 0 8px; font-size: 12px; font-weight: 600; }
.matrix-card-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; margin: 10px 0; }
.matrix-card-head .banner-logo { width: 170px; }
.update-strip { box-shadow: none; border-radius: 8px; }
.matrix-wrap { max-height: 42vh; }
.matrix-table thead th { position: sticky; top: 0; z-index: 1; }
.matrix-table :is(th, td):first-child { position: sticky; left: 0; background: #f8fafc; z-index: 1; }
.matrix-table thead th:first-child { z-index: 2; }
.meta-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin: 0; }
.meta-box { padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; font-size: 14px; }
.meta-box strong { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.citation-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; }
.citation-controls button { width: auto; padding: 7px 12px; font-size: 13px; }
.selection-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin: 0 0 9px; font-size: 13px; }
.selection-toolbar [role=status] { margin-right: 6px; }
.selection-toolbar button { width: auto; padding: 5px 10px; font-size: 13px; }
.selection-toolbar a { margin-left: auto; }
.desktop-exports { display: none; }
.abstract-unavailable { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 9px 0; }
.paper-card { margin-bottom: 10px; padding: 13px 15px; }
.paper-card:has(.paper-check input:checked) { border-color: #5988c8; box-shadow: inset 3px 0 #3573c5; }
.paper-top { grid-template-columns: 36px minmax(0, 1fr) minmax(155px, 22%); gap: 10px; }
.paper-check { display: grid; place-items: center; cursor: pointer; width: 36px; min-height: 40px; border-radius: 6px; }
.paper-check input[type=checkbox] { width: 19px; height: 19px; margin: 0; accent-color: #235fab; cursor: pointer; }
.paper-card .title { margin: 0; font-size: 17px; font-weight: 720; line-height: 1.42; overflow-wrap: anywhere; }
.paper-card .meta-row { margin-block: 5px; font-size: 14px; overflow-wrap: anywhere; }
.paper-card .result-index { font-size: 13px; font-variant-numeric: tabular-nums; min-width: auto; padding-top: 3px; }
.result-banner { padding: 6px 9px; gap: 4px 10px; margin-bottom: 8px; border-radius: 7px; }
.relevance, .score-side { font-size: 13px; }
.result-banner .match-badge { font-size: 11px; }
.side-col { align-content: start; border-left: 1px solid #e4eaf1; padding-left: 12px; gap: 6px; }
.paper-stats, .paper-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.paper-stats strong { color: var(--muted); font-weight: 600; }
.paper-notes { margin: 0; padding: 6px 9px; }
.paper-notes summary { font-size: 13px; }
.paper-notes label { display: block; margin: 6px 0 3px; }
.paper-links a { padding: 3px 0; text-decoration: underline; text-underline-offset: 2px; }
.search-progress-card { border-radius: 15px; }
.search-progress-bar { height: 6px; }
.search-progress-bar span { background: #4282da; }
.queue-link:not([hidden]) { display: inline-block; margin-top: 14px; padding-block: 4px; }
#searchFormError { margin: 8px 0; }
.skip-search, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-search:focus { top: 8px; left: 8px; width: auto; height: auto; padding: 12px; clip-path: none; z-index: 100; background: white; }
.shell :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible, .queue-link:focus-visible { outline: 3px solid #1f65b6; outline-offset: 2px; }
@media (hover: hover) {
  .search-actions button:enabled:hover, .selection-toolbar button:hover { filter: brightness(.95); }
  .paper-check:hover { background: #eef4fc; }
}
@media (prefers-reduced-motion: no-preference) {
  .paper-card, .paper-check { transition: border-color .14s, background-color .14s, box-shadow .14s; }
  .search-overlay.is-active .search-progress-card { animation: workspace-appear .16s ease-out; }
  @keyframes workspace-appear { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .search-progress-bar span, .wechat-modal, .wechat-modal-overlay.active { animation: none; }
  .btn-ultra { transition: none; }
}
@media (min-width: 1041px) {
  #search-results .meta-grid { display: flex; flex-wrap: wrap; }
  #search-results .meta-box { flex: 1 1 112px; min-width: 0; }
  #search-results .meta-box:first-child { flex: 2 1 230px; }
  .selection-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 0 0 9px 9px;
    background: #f8fafc;
    box-shadow: 0 2px 5px rgb(24 46 70 / 8%);
  }
  .selection-toolbar [role=status] { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .desktop-exports { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-left: auto; }
  .desktop-exports > span { margin-right: 3px; color: var(--muted); }
  .desktop-exports button { color: #174d8a; border-color: #b8cbe2; }
  .desktop-exports button:disabled { color: #606f7d; border-color: #d9e1e8; background: #eff3f6; cursor: not-allowed; }
  .desktop-exports + a { margin-left: 4px; }
  .paper-card, .paper-card :is(a, input, button, summary, select, textarea) { scroll-margin-top: 64px; }
  .paper-top { grid-template-columns: 36px minmax(0, 1fr) minmax(225px, 22%); }
  .paper-card .title { font-size: 18px; line-height: 1.35; text-wrap: balance; }
  .paper-card .title-row { margin-bottom: 6px; }
  .paper-card .result-index { padding-top: 2px; }
  .paper-disclosures { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-top: 9px; }
  .paper-disclosures > details { margin: 0; min-width: 0; padding: 0 10px; }
  .paper-disclosures > details > summary { padding-block: 7px; font-size: 14px; }
  .paper-disclosures > details[open] { flex: 1 0 100%; }
  .paper-disclosures .abstract-unavailable { margin: 0 6px 0 0; }
  .paper-abstract .abstract-copy { max-width: 76ch; margin: 0 0 10px; font-size: 15px; line-height: 1.65; }
  .paper-notes textarea {
    field-sizing: content;
    min-height: 9.5rem;
    max-height: 20rem;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
  }
}
@media (min-width: 1041px) and (prefers-reduced-motion: no-preference) {
  .desktop-exports button { transition: background-color .12s, border-color .12s; }
  .paper-abstract[open] .abstract-copy { animation: abstract-in .15s ease-out; }
  @keyframes abstract-in { from { opacity: .6; } to { opacity: 1; } }
}
@media (max-width: 1040px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  aside { padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); }
  .workspace-brand { margin-bottom: 6px; }
  .workspace-brand img { width: 34px; height: 34px; }
  .rail-panel { margin: 3px 0 0; padding: 0; }
  .rail-panel > summary { padding-block: 8px; font-size: 14px; }
  main { padding: 14px 12px; }
  .paper-top { grid-template-columns: 40px minmax(0, 1fr); gap: 2px 7px; }
  .paper-top .side-col { grid-column: 2; border-left: 0; padding: 5px 0 0; }
  .paper-check { width: 40px; min-height: 44px; }
  .matrix-card-head { grid-template-columns: minmax(0, 1fr); }
  .matrix-card-head .banner-logo { max-height: 60px; width: auto; max-width: 100%; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .workspace-heading { margin-bottom: 12px; }
  .card, .paper-card { padding: 13px; }
  .search-actions { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .search-actions > * { padding: 9px; }
  .ultra-search-entry { margin-top: 9px; padding-top: 9px; }
  .paper-top { grid-template-columns: minmax(0, 1fr); }
  .paper-top .side-col { grid-column: 1; }
  .paper-card { position: relative; }
  .paper-check { position: absolute; top: 6px; right: 6px; width: 44px; }
  .result-banner { margin-right: 34px; min-height: 31px; }
  .side-col { border-top: 1px solid #e4eaf1; margin-top: 7px; }
  .paper-list summary, .selection-toolbar button, .selection-toolbar a, .paper-links a { min-height: 40px; align-content: center; }
  .search-advanced > summary { min-height: 40px; align-content: center; }
  .matrix-title-sub { display: block; margin-left: 16px; }
  .search-progress-card { padding: 19px; }
  .search-progress-title { font-size: 20px; }
}
