#researchModal .research-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.dashboard-toolbar > .research-actions { display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
body:has(#researchModal.active) .dashboard-toolbar > .research-actions { display: flex; }
.dashboard-toolbar > .research-actions label { font-weight: 600; }
.dashboard-toolbar > .research-actions input { min-height: 34px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); padding: 6px 10px; background: var(--ui-surface); color: inherit; }
.dashboard-toolbar > .research-actions #researchYear { width: 104px; }
.dashboard-toolbar > .research-actions button { cursor: pointer; border-radius: var(--ui-radius-sm); padding: 6px 12px; font: inherit; }
.dashboard-toolbar > .research-actions button[hidden] { display: none; }

#researchModal .research-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#researchModal .research-actions label { font-weight: 600; }
#researchModal input { min-height: 34px; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); padding: 6px 10px; background: var(--ui-surface); color: inherit; }
#researchModal #researchYear { width: 104px; }
:where(#researchModal) button { cursor: pointer; border: 1px solid var(--ui-border-strong); border-radius: var(--ui-radius-sm); padding: 6px 12px; background: var(--ui-surface); color: inherit; font: inherit; }
:where(#researchModal) button:hover { filter: brightness(.96); }
#researchModal button:disabled { opacity: .6; cursor: wait; }
#researchModal .research-status { min-height: 22px; margin-bottom: 8px; color: var(--ui-text-muted, #667085); }
#researchModal .research-status:empty { display: none; }
#researchModal .research-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
#researchModal .research-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 20px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); text-align: left; }
#researchModal .research-tile span { color: var(--ui-text-muted, #667085); font-size: 13px; }
#researchModal .research-tile strong { font-size: 30px; }
#researchModal .research-tile:hover,
#researchModal .research-tile:focus-visible { border-color: var(--ui-primary, #2457a7); }
.research-table { width: 100%; border-collapse: collapse; }
.research-table th,
.research-table td { padding: 10px 12px; border-bottom: 1px solid var(--ui-border, #d9e1ea); text-align: left; }
.research-table th:nth-child(n+2),
.research-table td:nth-child(n+2) { width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.research-table .research-sorted { background: var(--ui-surface-muted, #f3f6fa); font-weight: 700; }
#researchModal .research-name,
#researchRankModal .research-name { border: 0; background: none; padding: 0; color: var(--ui-primary, #2457a7); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
#researchModal .research-name:hover,
#researchRankModal .research-name:hover { text-decoration: underline; }
#researchRankModal .modal,
#researchCardModal .modal { width: 96vw; }
#researchRankModal .modal { max-width: 900px; }
#researchCardModal .modal { max-width: 640px; }
#researchRankBody { overflow: auto; }
#researchCardModal .research-card { display: flex; flex-direction: column; color: var(--ui-text, #172033); }
#researchCardModal .research-degree { min-height: 20px; margin: 0 0 17px; color: var(--ui-text-muted, #667085); }
#researchCardModal .research-current-year { margin-bottom: 14px; padding: 13px; border: 1px solid var(--ui-border, #d9e1ea); border-radius: 10px; }
#researchCardModal .research-current-year h4 { margin: 0 0 10px; font-size: 14px; }
#researchCardModal .research-year-stats { display: grid; grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) minmax(80px, 1fr); gap: 9px; }
#researchCardModal .research-article-group,
#researchCardModal .research-year-patents,
#researchCardModal .research-year-talks { padding: 10px; border-radius: var(--ui-radius-md); background: var(--ui-surface-muted, #f3f6fa); }
#researchCardModal .research-article-group h5,
#researchCardModal .research-year-patents h5,
#researchCardModal .research-year-talks h5 { margin: 0 0 9px; color: var(--ui-text-muted, #667085); font-size: 12px; font-weight: 600; }
#researchCardModal .research-article-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#researchCardModal .research-article-kinds > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
#researchCardModal .research-article-kinds dt { color: var(--ui-text-muted, #667085); font-size: 12px; }
#researchCardModal .research-article-kinds dd { margin: 0; font-size: 16px; font-weight: 700; }
#researchCardModal .research-article-total { margin: 8px 0 0; padding-top: 7px; border-top: 1px solid var(--ui-border, #d9e1ea); text-align: center; font-size: 12px; font-weight: 700; }
#researchCardModal .research-year-patents strong,
#researchCardModal .research-year-talks strong { font-size: 20px; }
#researchCardModal .research-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
#researchCardModal .research-card dl > div { padding: 11px; border-radius: 9px; background: var(--ui-surface-muted, #f3f6fa); }
#researchCardModal .research-card dt { color: var(--ui-text-muted, #667085); font-size: 12px; }
#researchCardModal .research-card dd { margin: 3px 0 0; font-size: 20px; font-weight: 700; }
#researchCardModal .research-history { margin: 16px 0 0; color: var(--ui-text-muted, #667085); font-size: 12px; }
#researchCardModal .modal-corner { top: 25px; }
#researchCardModal h2 { margin: 0 0 2px; line-height: 32px; }
#researchCardModal .modal:has(.research-card-actions button) h2 { padding-right: 250px; }
#researchCardModal .research-card-actions { display: flex; gap: 8px; }
#researchCardModal .research-card-actions button { cursor: pointer; border: 1px solid var(--ui-border, #cbd5e1); border-radius: var(--ui-radius-md); padding: 4px 12px; background: var(--ui-surface, #fff); color: inherit; font: inherit; font-size: 13px; }
#researchCardModal .research-delete { color: #a22735; }
#researchModal .research-form { max-width: 710px; margin-top: 24px; padding: 20px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-md); background: var(--ui-surface-subtle); }
#researchModal .research-form[hidden] { display: none; }
#researchModal .research-form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
#researchModal .research-form-head h3 { margin: 0; font-size: 15px; }
#researchModal .research-form-head button { padding: 3px 11px; font-size: 24px; }
#researchModal .research-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#researchModal .research-fields label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
#researchModal .research-fields input { width: 100%; }
#researchModal .research-wide { grid-column: 1 / -1; }
#researchModal .research-form-year { padding-top: 9px; font-weight: 700; }
#researchModal .research-form-actions { display: flex; gap: 9px; margin-top: 22px; }
#researchModal .research-error { margin-top: 12px; color: #a22735; }

@media (max-width: 600px) {
  #researchModal .research-summary { grid-template-columns: 1fr; }
  #researchModal .research-actions { width: 100%; }
  #researchModal .research-fields { grid-template-columns: 1fr; }
  #researchModal .research-wide { grid-column: auto; }
  #researchModal .research-form { padding: 16px; }
}
