:root {
  --research-navy: #10233F;
  --research-gold: #F7C928;
  --research-orange: #F2A60C;
  --research-cream: #FFFDF0;
  --research-soft: #FFF9C4;
  --research-border: #E9E2C8;
  --research-muted: #6B7280;
  --research-green: #166534;
}

html, body { min-height: 100%; }
body.research-page {
  margin: 0;
  background: var(--research-cream);
  color: var(--research-navy);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.research-skip-link { position:absolute; left:-9999px; top:0; }
.research-skip-link:focus { left:16px; top:12px; z-index:2000; padding:.6rem .9rem; background:#fff; border:1px solid var(--research-border); border-radius:12px; }
.research-navbar { position:sticky; top:0; z-index:1020; background:#fff; border-bottom:1px solid var(--research-border); }
.research-navbar-inner { max-width:1280px; margin:0 auto; padding:.72rem 1rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.research-brand { display:flex; align-items:center; gap:.72rem; text-decoration:none; color:var(--research-navy); }
.research-brand img { width:42px; height:42px; border-radius:14px; object-fit:cover; }
.research-brand-copy { display:flex; flex-direction:column; line-height:1.08; }
.research-brand-copy strong { font-family:"Libre Baskerville", Georgia, serif; }
.research-brand-copy small { margin-top:.18rem; color:var(--research-muted); font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.research-nav-actions { display:flex; align-items:center; gap:.55rem; }
.research-user { color:var(--research-muted); font-size:.82rem; font-weight:700; }
.research-shell { max-width:1280px; margin:0 auto; padding:30px 18px 56px; }
.research-hero { background:#fff; border:1px solid var(--research-border); border-radius:24px; padding:24px; display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.research-kicker { display:inline-flex; align-items:center; gap:.4rem; border:1px solid var(--research-border); background:var(--research-soft); border-radius:999px; padding:.34rem .72rem; font-size:.73rem; font-weight:800; }
.research-hero h1, .research-section h2, .research-card h2 { font-family:"Libre Baskerville", Georgia, serif; color:var(--research-navy); }
.research-hero h1 { font-size:clamp(1.75rem, 3vw, 2.4rem); margin:.7rem 0 .45rem; }
.research-hero p { margin:0; color:var(--research-muted); max-width:760px; line-height:1.6; }
.research-section { background:#fff; border:1px solid var(--research-border); border-radius:24px; padding:22px; margin-bottom:18px; }
.research-section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; }
.research-section-head h2 { font-size:1.25rem; margin:0; }
.research-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.research-card { border:1px solid var(--research-border); border-radius:20px; padding:18px; background:#fff; }
.research-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.research-card h2 { font-size:1.08rem; margin:0 0 .55rem; line-height:1.4; }
.research-card p { color:var(--research-muted); min-height:2.5em; }
.research-number { font-weight:800; font-size:.78rem; }
.research-status { display:inline-flex; align-items:center; border-radius:999px; padding:.3rem .65rem; border:1px solid var(--research-border); background:var(--research-soft); color:var(--research-navy); font-size:.7rem; font-weight:800; }
.research-status.linked { background:#ecfdf3; color:var(--research-green); border-color:#bbf7d0; }
.research-status.pending { background:#fff7ed; color:#9a3412; border-color:#fed7aa; }
.research-primary-button { background:var(--research-gold) !important; border-color:var(--research-gold) !important; color:var(--research-navy) !important; font-weight:800; border-radius:999px; }
.research-primary-button:hover { background:var(--research-orange) !important; border-color:var(--research-orange) !important; }
.research-empty-card { display:flex; flex-direction:column; align-items:center; text-align:center; gap:.5rem; padding:34px 20px; border:1px dashed var(--research-border); border-radius:20px; color:var(--research-muted); background:#fffdf7; }
.research-empty-card i { font-size:2rem; color:var(--research-orange); }
.research-empty-card strong { color:var(--research-navy); }
.research-empty-card.compact { padding:20px; }
.research-detail-grid { display:grid; grid-template-columns:1.1fr .9fr; gap:18px; }
.research-meta-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.research-meta-item { border:1px solid var(--research-border); border-radius:16px; padding:14px; background:#fffdf7; }
.research-meta-item small { display:block; color:var(--research-muted); font-weight:700; margin-bottom:.25rem; }
.research-meta-item strong { display:block; }
.research-member-row { display:flex; align-items:center; justify-content:space-between; gap:14px; border:1px solid var(--research-border); border-radius:16px; padding:13px 14px; margin-bottom:9px; }
.research-member-row small { display:block; color:var(--research-muted); margin-top:.2rem; }
.research-phase-note { border-left:4px solid var(--research-gold); background:#fffdf7; padding:14px 16px; border-radius:0 16px 16px 0; color:var(--research-muted); }
.research-phase-note strong { color:var(--research-navy); }
#toastArea { position:fixed; right:18px; top:18px; width:min(390px,calc(100vw - 36px)); z-index:2000; }
.form-control, .form-select { border-radius:14px; border-color:var(--research-border); }
.form-control:focus, .form-select:focus { border-color:var(--research-gold); box-shadow:0 0 0 .2rem rgba(247,201,40,.18); }
@media (max-width: 960px) { .research-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .research-detail-grid { grid-template-columns:1fr; } }
@media (max-width: 640px) { .research-grid { grid-template-columns:1fr; } .research-hero { flex-direction:column; } .research-navbar-inner { align-items:flex-start; } .research-user { display:none; } .research-meta-list { grid-template-columns:1fr; } .research-member-row { align-items:flex-start; flex-direction:column; } }


/* =========================================================
   RESEARCH MODAL VIEWPORT
   Keep action buttons visible on shorter desktop/laptop
   viewports while allowing only the form body to scroll.
   ========================================================= */

#createResearchModal .modal-dialog {
  width: min(800px, calc(100vw - 32px));
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

#createResearchModal .research-create-modal-content {
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#createResearchModal .modal-header {
  flex: 0 0 auto;
}

#createResearchModal .research-modal-form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#createResearchModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 1rem;
}

#createResearchModal .modal-footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  background: #fff;
  border-top: 1px solid var(--research-border);
}

#createResearchModal .research-researcher-ids {
  min-height: 110px;
  max-height: 180px;
  resize: vertical;
}

@supports not (height: 100dvh) {
  #createResearchModal .research-create-modal-content {
    max-height: calc(100vh - 32px);
  }
}

@media (max-height: 700px) {
  #createResearchModal .modal-dialog {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  #createResearchModal .research-create-modal-content {
    max-height: calc(100dvh - 24px);
  }

  #createResearchModal .modal-header,
  #createResearchModal .modal-footer {
    padding-top: .75rem;
    padding-bottom: .75rem;
  }

  #createResearchModal .modal-body {
    padding-top: .85rem;
    padding-bottom: .85rem;
  }

  #createResearchModal .research-researcher-ids {
    min-height: 90px;
    max-height: 130px;
  }
}

@media (max-width: 576px) {
  #createResearchModal .modal-dialog {
    width: auto;
    margin: 8px;
  }

  #createResearchModal .research-create-modal-content {
    max-height: calc(100dvh - 16px);
  }

  #createResearchModal .modal-footer {
    gap: .5rem;
  }

  #createResearchModal .modal-footer .btn {
    flex: 1 1 0;
  }
}


/* =========================================================
   RESEARCHER NAME + NAVY HEADING
   ========================================================= */

/* Keep all Research Management headings on the established Physics SciEd navy theme. */
.research-page h1,
.research-page h2,
.research-page h3,
.research-page .modal-title,
.research-page .form-label,
.research-researcher-editor h3,
.research-add-researcher-form h3 {
  color: var(--research-navy) !important;
}

.research-researcher-editor {
  border-top: 1px solid var(--research-border);
  padding-top: 1rem;
}

.research-researcher-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
}

.research-researcher-editor-head h3,
.research-add-researcher-form h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.02rem;
  margin: 0 0 .35rem;
}

.research-researcher-editor-head p {
  color: var(--research-muted);
  margin: 0;
  line-height: 1.5;
  font-size: .88rem;
  max-width: 650px;
}

.research-researcher-columns,
.research-researcher-row {
  display: grid;
  grid-template-columns: minmax(145px, .9fr) minmax(210px, 1.2fr) minmax(180px, .95fr) auto;
  gap: .65rem;
  align-items: center;
}

.research-researcher-columns {
  padding: 0 .25rem .42rem;
  color: var(--research-navy);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .025em;
}

.research-researcher-row {
  border: 1px solid var(--research-border);
  border-radius: 16px;
  padding: .72rem;
  background: #fffdf7;
  margin-bottom: .65rem;
}

.research-researcher-field {
  min-width: 0;
}

.research-researcher-field .form-control[readonly],
#researcherNameInput[readonly] {
  background: #f8fafc;
  color: var(--research-navy);
  font-weight: 700;
}

.research-researcher-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
}

.researcher-lookup-status {
  border-radius: 999px;
  border: 1px solid var(--research-border);
  padding: .38rem .65rem;
  font-size: .73rem;
  font-weight: 750;
  line-height: 1.25;
  background: #f8fafc;
  color: var(--research-muted);
}

.researcher-lookup-status.checking {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.researcher-lookup-status.linked {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: var(--research-green);
}

.researcher-lookup-status.pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.researcher-lookup-status.manual {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.researcher-lookup-status.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.research-member-identity {
  min-width: 0;
}

.research-member-identity > strong {
  color: var(--research-navy);
  display: block;
  font-size: .96rem;
}

.research-member-id {
  display: inline-block;
  color: var(--research-muted);
  font-size: .78rem;
  font-weight: 800;
  margin-top: .18rem;
}

.research-add-researcher-form {
  border-top: 1px solid var(--research-border);
  padding-top: 1rem;
}

.research-add-researcher-grid {
  display: grid;
  grid-template-columns: minmax(150px, .85fr) minmax(210px, 1.15fr) auto;
  gap: .7rem;
  align-items: end;
}

.research-add-researcher-action {
  display: flex;
  align-items: end;
  padding-bottom: 1px;
}

@media (max-width: 767.98px) {
  .research-researcher-editor-head {
    flex-direction: column;
  }

  .research-researcher-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .research-researcher-actions {
    justify-content: flex-start;
  }

  .research-add-researcher-grid {
    grid-template-columns: 1fr;
  }

  .research-add-researcher-action .btn {
    width: 100%;
  }
}


/* =========================================================
   RESEARCH MANAGEMENT — DOCUMENTS
   ========================================================= */

.research-document-grid {
  display: grid;
  gap: 1rem;
}

.research-document-card {
  border: 1px solid var(--research-border);
  border-radius: 20px;
  background: #fff;
  padding: 1.1rem;
}

.research-document-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.research-document-card h3 {
  margin: .3rem 0 .35rem;
  color: var(--research-navy) !important;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.05rem;
}

.research-document-card p {
  margin: 0;
  color: var(--research-muted);
  max-width: 760px;
}

.research-document-count {
  flex: 0 0 auto;
  border: 1px solid var(--research-border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--research-navy);
  padding: .38rem .65rem;
  font-size: .74rem;
  font-weight: 800;
}

.research-document-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  padding: .85rem;
  border: 1px dashed #b7c0cc;
  border-radius: 16px;
  background: #fbfcfe;
}

.research-document-upload-form .research-upload-progress {
  grid-column: 1 / -1;
}

.research-revision-history {
  margin-top: 1rem;
}

.research-revision-history h4 {
  color: var(--research-navy);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: .55rem;
}

.research-revision-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--research-border);
}

.research-revision-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .75rem 0;
  border-bottom: 1px solid var(--research-border);
}

.research-revision-main {
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.research-revision-main > span {
  word-break: break-word;
  color: #334155;
}

.research-revision-main small {
  color: var(--research-muted);
}

.research-revision-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--research-navy);
}

.research-current-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--research-green);
  border: 1px solid #bbf7d0;
  padding: .15rem .45rem;
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.research-empty-inline {
  border: 1px dashed var(--research-border);
  border-radius: 14px;
  padding: .8rem;
  color: var(--research-muted);
  background: #fafafa;
}

.research-document-card.evaluator .research-revision-history {
  margin-top: .5rem;
}

@media (max-width: 767.98px) {
  .research-document-card-head,
  .research-revision-item {
    align-items: stretch;
    flex-direction: column;
  }

  .research-document-upload-form {
    grid-template-columns: 1fr;
  }

  .research-document-upload-form .btn,
  .research-revision-item .btn {
    width: 100%;
  }
}

/* =========================================================
   DOCUMENT WORKSPACE
   ========================================================= */

.research-workspace-hero {
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
  border: 1px solid var(--research-border);
  border-radius: 26px;
  padding: 1.35rem;
  margin-bottom: 1.1rem;
}

.research-workspace-hero-main {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.research-workspace-left {
  min-width: 0;
}

.research-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .9rem 0 1rem;
}

.research-info-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--research-border);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--research-navy);
  padding: .42rem .8rem;
  font-size: .8rem;
  font-weight: 700;
}

.research-info-pill.status {
  background: #eef4ff;
  border-color: #c7d2fe;
}

.research-researchers-summary {
  display: grid;
  gap: .45rem;
}

.research-researchers-summary small {
  color: var(--research-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.researcher-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.researcher-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border-radius: 999px;
  border: 1px solid var(--research-border);
  background: #fffdf7;
  color: var(--research-navy);
  padding: .4rem .72rem;
  font-size: .8rem;
  font-weight: 700;
}

.researcher-chip.linked {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: var(--research-green);
}

.researcher-chip.pending {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.research-document-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.research-doc-overview-card {
  border: 1px solid var(--research-border);
  border-radius: 22px;
  background: #ffffff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.research-doc-overview-card.manuscript {
  border-color: #c9d7ef;
  background: linear-gradient(180deg, #fcfdff 0%, #ffffff 100%);
}

.research-doc-overview-card.evaluator {
  background: #fff;
}

.research-doc-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}

.research-doc-overview-head h3 {
  margin: .3rem 0 0;
  color: var(--research-navy);
  font-size: 1.03rem;
  font-family: "Libre Baskerville", Georgia, serif;
}

.research-doc-overview-card p {
  margin: 0;
  color: var(--research-muted);
  line-height: 1.5;
  font-size: .9rem;
}

.research-doc-state {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .35rem .62rem;
  font-size: .74rem;
  font-weight: 800;
  border: 1px solid var(--research-border);
  background: #f8fafc;
  color: var(--research-muted);
}

.research-doc-state.active {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: var(--research-green);
}

.research-doc-state.pending {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.research-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem 1rem;
  color: var(--research-muted);
  font-size: .8rem;
}

.research-doc-meta span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.research-doc-current-file {
  display: grid;
  gap: .2rem;
  padding: .75rem;
  border: 1px dashed #d1d9e6;
  border-radius: 16px;
  background: #fbfcfe;
}

.research-doc-current-file.empty {
  background: #fafafa;
}

.research-doc-current-file strong {
  color: var(--research-navy);
  word-break: break-word;
}

.research-doc-current-file small {
  color: var(--research-muted);
}

.research-doc-card-actions {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: auto;
}

.research-doc-card-actions .btn {
  flex: 1 1 0;
}

.research-upload-modal-intro {
  display: grid;
  gap: .55rem;
}

.research-upload-current {
  border-radius: 16px;
  border: 1px dashed #d1d9e6;
  padding: .85rem;
  background: #fbfcfe;
  color: #334155;
  line-height: 1.55;
}

.research-upload-progress-modal .progress {
  height: .85rem;
}

.research-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.research-timeline-list::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
}

.research-timeline-item {
  position: relative;
  padding-left: 44px;
  margin-bottom: 1rem;
}

.research-timeline-item:last-child {
  margin-bottom: 0;
}

.research-timeline-marker {
  position: absolute;
  left: 9px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  border: 4px solid #10233F;
}

.research-timeline-card {
  border: 1px solid var(--research-border);
  border-radius: 18px;
  background: #fff;
  padding: .95rem 1rem;
}

.research-timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.research-timeline-top > div {
  min-width: 0;
  display: grid;
  gap: .18rem;
}

.research-timeline-top > div > span {
  color: #334155;
  word-break: break-word;
}

.research-timeline-top small {
  color: var(--research-muted);
}

@media (max-width: 991.98px) {
  .research-document-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .research-workspace-hero-main,
  .research-timeline-top,
  .research-doc-overview-head,
  .research-doc-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .research-doc-card-actions .btn,
  .research-timeline-top .btn {
    width: 100%;
  }

  .research-workspace-right {
    width: 100%;
  }

  .research-workspace-right .btn {
    width: 100%;
  }
}


/* =========================================================
   RESEARCH LAYOUT WIDTH
   Widen the main research workspace containers so they
   fit desktop screens better with only a small allowance.
   ========================================================= */

.research-navbar-inner,
.research-shell {
  box-sizing: border-box;
  width: min(1440px, calc(100vw - 24px));
  max-width: none;
}

.research-navbar-inner {
  padding-left: 14px;
  padding-right: 14px;
}

.research-shell {
  padding-left: 14px;
  padding-right: 14px;
}

.research-hero,
.research-section,
.research-workspace-hero {
  width: 100%;
}

@media (max-width: 767.98px) {
  .research-navbar-inner,
  .research-shell {
    width: calc(100vw - 12px);
  }

  .research-navbar-inner,
  .research-shell {
    padding-left: 10px;
    padding-right: 10px;
  }
}


/* =========================================================
   RESEARCH HEADER NAVY + GOLD
   Convert the top Research header from white to a navy bar
   with a gold accent, aligned with the other Physics SciEd pages.
   ========================================================= */

.research-navbar {
  background: var(--research-navy);
  border-bottom: 3px solid var(--research-gold);
}

.research-navbar::after {
  content: "";
  display: block;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.research-brand {
  color: #ffffff;
}

.research-brand-copy strong {
  color: #ffffff;
}

.research-brand-copy small {
  color: #f6df8d;
}

.research-user {
  color: #f8fafc;
}

.research-nav-actions .btn {
  background: rgba(255, 255, 255, 0.04);
  border-width: 1px;
}

.research-nav-actions .btn-outline-secondary {
  color: #ffffff;
  border-color: rgba(247, 201, 40, 0.78);
}

.research-nav-actions .btn-outline-secondary:hover,
.research-nav-actions .btn-outline-secondary:focus {
  color: var(--research-navy);
  background: var(--research-gold);
  border-color: var(--research-gold);
}

.research-nav-actions .btn-outline-danger {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.46);
}

.research-nav-actions .btn-outline-danger:hover,
.research-nav-actions .btn-outline-danger:focus {
  color: #ffffff;
  background: #b91c1c;
  border-color: #b91c1c;
}


/* =========================================================
   TEACHER RESEARCH DOCUMENTS LAYOUT
   Fix overlapping document cards and replace the circular
   refresh button with a normal compact button.
   ========================================================= */

/* Teacher project: keep action buttons compact and readable */
#pageContent .research-section-head {
  align-items: flex-start;
}

#refreshProjectBtn,
#refreshDocumentsBtn {
  flex: 0 0 auto;
  width: auto;
  min-width: 148px;
  padding: 0.78rem 1rem;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 16px !important;
  align-self: flex-start;
}

#refreshDocumentsBtn i,
#refreshProjectBtn i {
  margin-right: 0.35rem;
}

/* Teacher project: document cards should wrap cleanly inside the left panel */
#teacherResearchDocuments.research-document-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

#teacherResearchDocuments .research-doc-overview-card {
  min-width: 0;
  height: 100%;
}

#teacherResearchDocuments .research-doc-overview-head {
  flex-wrap: wrap;
}

#teacherResearchDocuments .research-doc-overview-head > div,
#teacherResearchDocuments .research-doc-current-file,
#teacherResearchDocuments .research-doc-overview-card p {
  min-width: 0;
}

#teacherResearchDocuments .research-doc-state {
  white-space: nowrap;
}

#teacherResearchDocuments .research-doc-current-file strong,
#teacherResearchDocuments .research-doc-overview-card h3 {
  overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
  #teacherResearchDocuments.research-document-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 767.98px) {
  #refreshProjectBtn,
  #refreshDocumentsBtn {
    width: 100%;
    min-width: 0;
  }

  #teacherResearchDocuments.research-document-summary-grid {
    grid-template-columns: 1fr;
  }
}



/* =========================================================
   RESEARCH MANAGEMENT — EVALUATION
   ========================================================= */

.research-evaluation-round-list,
.research-student-evaluation-list {
  display: grid;
  gap: .9rem;
}

.research-evaluation-round-card,
.research-student-evaluation-card {
  border: 1px solid var(--research-border);
  border-radius: 20px;
  background: #fff;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.research-evaluation-round-card.published,
.research-student-evaluation-card.current {
  border-color: #c9d7ef;
  background: linear-gradient(180deg, #fcfdff 0%, #ffffff 100%);
}

.research-evaluation-round-main,
.research-student-evaluation-main {
  min-width: 0;
  flex: 1 1 auto;
}

.research-evaluation-round-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.research-evaluation-round-number {
  color: var(--research-navy);
  font-weight: 800;
}

.research-evaluation-round-card h3,
.research-student-evaluation-card h3 {
  color: var(--research-navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.02rem;
  margin: .45rem 0 .25rem;
}

.research-evaluation-round-card p,
.research-student-evaluation-card p {
  color: var(--research-muted);
  margin: 0 0 .45rem;
}

.research-evaluation-round-actions,
.research-student-evaluation-actions {
  flex: 0 0 auto;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.research-evaluation-modal-content {
  max-height: calc(100dvh - 28px);
}

.research-evaluation-editor-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}

.research-evaluation-section-head,
.research-evaluation-section-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .8rem;
}

.research-evaluation-section-head h4,
.research-evaluation-result-section h4 {
  color: var(--research-navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1rem;
  margin: 0 0 .3rem;
}

.research-evaluation-sections {
  display: grid;
  gap: 1rem;
  margin-top: .85rem;
}

.research-evaluation-section-card {
  border: 1px solid var(--research-border);
  border-radius: 18px;
  padding: .9rem;
  background: #fffdf8;
}

.evaluation-feedback-column-head,
.evaluation-feedback-row {
  display: grid;
  grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: start;
}

.evaluation-feedback-column-head {
  color: var(--research-navy);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: .8rem;
  padding: 0 .15rem;
}

.evaluation-feedback-list {
  display: grid;
  gap: .65rem;
  margin-top: .4rem;
}

.evaluation-feedback-row {
  border-top: 1px solid var(--research-border);
  padding-top: .65rem;
}

.evaluation-feedback-row .btn {
  margin-top: .15rem;
}

.research-evaluation-details {
  border-top: 1px solid var(--research-border);
  padding-top: .75rem;
}

.research-evaluation-details summary {
  cursor: pointer;
  color: var(--research-navy);
  font-weight: 800;
}

.research-evaluation-details-body {
  display: grid;
  gap: 1rem;
  margin-top: .9rem;
}

.research-evaluation-result-section {
  border: 1px solid var(--research-border);
  border-radius: 16px;
  padding: .85rem;
  background: #fbfcfe;
}

.research-evaluation-result-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .6rem;
}

.research-evaluation-result-section li {
  border-top: 1px dashed #d6dce6;
  padding-top: .55rem;
}

.research-evaluation-result-section li:first-child {
  border-top: 0;
  padding-top: 0;
}

.research-feedback-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: .22rem .5rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: .7rem;
  font-weight: 800;
  margin-bottom: .3rem;
}

.research-evaluation-result-section p {
  margin: 0;
  white-space: pre-wrap;
}

.research-evaluation-result-section.overall {
  border-left: 4px solid var(--research-gold);
}

.research-notification-item {
  width: 100%;
  border: 1px solid var(--research-border);
  border-radius: 16px;
  background: #fff;
  padding: .75rem .85rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  text-align: left;
  margin-bottom: .6rem;
}

.research-notification-item.unread {
  background: #fffdf2;
  border-color: #edd88a;
}

.research-notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--research-soft);
  color: var(--research-navy);
}

.research-notification-item strong {
  display: block;
  color: var(--research-navy);
}

.research-notification-item small {
  display: block;
  color: var(--research-muted);
  margin-top: .15rem;
}

.research-notification-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--research-gold);
}

@media (max-width: 991.98px) {
  .research-evaluation-round-card,
  .research-student-evaluation-card {
    align-items: stretch;
    flex-direction: column;
  }

  .research-evaluation-round-actions,
  .research-student-evaluation-actions {
    width: 100%;
  }

  .research-evaluation-round-actions .btn,
  .research-student-evaluation-actions .btn {
    flex: 1 1 0;
  }
}

@media (max-width: 767.98px) {
  .research-evaluation-editor-toolbar,
  .evaluation-feedback-column-head,
  .evaluation-feedback-row {
    grid-template-columns: 1fr;
  }

  .research-evaluation-section-head,
  .research-evaluation-section-card-head {
    flex-direction: column;
  }

  .research-evaluation-round-actions,
  .research-student-evaluation-actions {
    flex-direction: column;
  }

  .research-evaluation-round-actions .btn,
  .research-student-evaluation-actions .btn {
    width: 100%;
  }
}


/* =========================================================
   EVALUATION MODAL VIEWPORT
   Keep the evaluation action buttons visible while the
   evaluation editor itself scrolls inside the viewport.
   ========================================================= */

#evaluationModal .modal-dialog {
  width: min(1140px, calc(100vw - 28px));
  max-width: 1140px;
  height: calc(100dvh - 28px);
  margin: 14px auto;
  align-items: stretch;
}

#evaluationModal .research-evaluation-modal-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 28px);
  overflow: hidden;
}

#evaluationModal .modal-header {
  flex: 0 0 auto;
}

#evaluationModal #evaluationForm {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#evaluationModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 1.25rem;
}

#evaluationModal .modal-footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 4;
  background: #ffffff;
  border-top: 1px solid var(--research-border);
  padding-top: .85rem;
  padding-bottom: .85rem;
}

#evaluationModal .modal-footer .btn {
  white-space: nowrap;
}

@supports not (height: 100dvh) {
  #evaluationModal .modal-dialog {
    height: calc(100vh - 28px);
  }

  #evaluationModal .research-evaluation-modal-content {
    max-height: calc(100vh - 28px);
  }
}

@media (max-height: 760px) {
  #evaluationModal .modal-dialog {
    height: calc(100dvh - 16px);
    margin: 8px auto;
  }

  #evaluationModal .research-evaluation-modal-content {
    max-height: calc(100dvh - 16px);
  }

  #evaluationModal .modal-header {
    padding-top: .7rem;
    padding-bottom: .7rem;
  }

  #evaluationModal .modal-body {
    padding-top: .75rem;
  }

  #evaluationModal .modal-footer {
    padding-top: .65rem;
    padding-bottom: .65rem;
  }
}

@media (max-width: 767.98px) {
  #evaluationModal .modal-dialog {
    width: calc(100vw - 12px);
    height: calc(100dvh - 12px);
    margin: 6px auto;
  }

  #evaluationModal .research-evaluation-modal-content {
    max-height: calc(100dvh - 12px);
  }

  #evaluationModal .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  #evaluationModal .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
}


/* =========================================================
   RICH-TEXT EVALUATION EDITOR
   ========================================================= */

.research-rich-editor-wrap {
  border: 1px solid var(--research-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.research-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  padding: .42rem;
  border-bottom: 1px solid var(--research-border);
  background: #f8fafc;
}

.research-rich-tool {
  min-height: 32px;
  border: 1px solid #d6dce6;
  border-radius: 8px;
  background: #fff;
  color: var(--research-navy);
  padding: .28rem .5rem;
  font-size: .76rem;
  font-weight: 750;
  line-height: 1;
}

.research-rich-tool:hover,
.research-rich-tool:focus {
  border-color: var(--research-gold);
  background: #fffdf0;
}

.research-rich-editor {
  min-height: 112px;
  max-height: 300px;
  overflow-y: auto;
  padding: .72rem .8rem;
  color: #1f2937;
  line-height: 1.55;
  outline: none;
  white-space: normal;
}

.research-rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.research-rich-editor[contenteditable="false"] {
  max-height: none;
  overflow: visible;
  background: #fbfcfe;
}

.research-rich-editor a,
.research-rich-content a {
  color: #0b57d0;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.research-rich-editor blockquote,
.research-rich-content blockquote {
  margin: .7rem 0;
  padding: .45rem .75rem;
  border-left: 4px solid var(--research-gold);
  background: #fffdf2;
}

.research-rich-editor code,
.research-rich-content code {
  padding: .08rem .28rem;
  border-radius: 5px;
  background: #f1f5f9;
}

.research-rich-editor table,
.research-rich-content table {
  width: 100%;
  border-collapse: collapse;
  margin: .7rem 0;
  table-layout: auto;
}

.research-rich-editor th,
.research-rich-editor td,
.research-rich-content th,
.research-rich-content td {
  border: 1px solid #cfd6e1;
  padding: .42rem .5rem;
  vertical-align: top;
  min-width: 72px;
}

.research-rich-editor th,
.research-rich-content th {
  background: #f8fafc;
  color: var(--research-navy);
  font-weight: 800;
}

.research-rich-editor ul,
.research-rich-editor ol,
.research-rich-content ul,
.research-rich-content ol {
  padding-left: 1.5rem;
  margin: .45rem 0;
}

.research-rich-editor p,
.research-rich-content p {
  margin: .35rem 0;
}

.research-equation {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: middle;
  padding: .14rem .35rem;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--research-navy);
  font-family: "Courier New", monospace;
}

.research-rich-content {
  color: #334155;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.evaluation-feedback-comment {
  min-width: 0;
}

.evaluation-feedback-comment .research-rich-editor {
  min-height: 96px;
}

#evaluationOverallRemarksEditor .research-rich-editor {
  min-height: 150px;
}

@media (max-width: 767.98px) {
  .research-rich-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .research-rich-tool {
    flex: 0 0 auto;
  }
}


/* =========================================================
   RICH-TEXT PARAGRAPH ALIGNMENT
   ========================================================= */

.research-rich-editor [data-align="left"],
.research-rich-content [data-align="left"] {
  text-align: left;
}

.research-rich-editor [data-align="center"],
.research-rich-content [data-align="center"] {
  text-align: center;
}

.research-rich-editor [data-align="right"],
.research-rich-content [data-align="right"] {
  text-align: right;
}

.research-rich-editor [data-align="justify"],
.research-rich-content [data-align="justify"] {
  text-align: justify;
  text-justify: inter-word;
}


/* =========================================================
   A4 OFFICIAL REPORT TEMPLATE
   ========================================================= */

.research-report-template-grid {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.research-report-template-settings,
.research-report-template-assets {
  min-width: 0;
}

.research-report-template-assets {
  display: grid;
  gap: .8rem;
}

.research-report-template-note {
  border: 1px solid #d9dee7;
  border-left: 4px solid var(--research-gold);
  border-radius: 14px;
  padding: .72rem .8rem;
  background: #fffdf5;
}

.research-report-template-note strong,
.research-report-template-note span {
  display: block;
}

.research-report-template-note strong {
  color: var(--research-navy);
  margin-bottom: .2rem;
}

.research-report-template-note span {
  color: var(--research-muted);
  font-size: .87rem;
}

.research-report-asset-card {
  border: 1px solid var(--research-border);
  border-radius: 18px;
  padding: .8rem;
  background: #fff;
}

.research-report-asset-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .65rem;
}

.research-report-asset-head strong {
  display: block;
  color: var(--research-navy);
}

.research-report-asset-head small {
  display: block;
  color: var(--research-muted);
  margin-top: .1rem;
}

.research-report-preview {
  width: 100%;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.research-report-preview.header {
  min-height: 86px;
}

.research-report-preview.footer {
  min-height: 72px;
}

.research-report-preview img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fff;
}

@media (max-width: 991.98px) {
  .research-report-template-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .research-report-asset-head {
    align-items: stretch;
    flex-direction: column;
  }

  .research-report-asset-head .btn {
    width: 100%;
  }
}


/* =========================================================
   TEACHER RESEARCH PROJECT LAYOUT
   Structural repair + uniform actions + stable evaluation
   round cards.
   ========================================================= */

/* The first two panels are the only two-column summary region. */
#pageContent > .research-detail-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}

#pageContent > .research-detail-grid > .research-section {
  min-width: 0;
  height: 100%;
  margin-bottom: 0;
}

/* All sections following the summary grid are full-width blocks. */
#pageContent > .research-section {
  width: 100%;
  min-width: 0;
  clear: both;
}

#pageContent > .research-section.mt-4 {
  margin-top: 0 !important;
  margin-bottom: 18px;
}

/* Section headers must reserve a stable area for their action button. */
#pageContent .research-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
}

#pageContent .research-section-head > div {
  min-width: 0;
}

#pageContent .research-section-head p {
  max-width: 900px;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   Page-level button harmonization
   --------------------------------------------------------- */
.research-page-action {
  box-sizing: border-box;
  min-width: 0 !important;
  width: auto !important;
  height: 38px;
  min-height: 38px;
  padding: 0 .82rem !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .36rem;
  line-height: 1;
  white-space: nowrap;
  font-size: .80rem;
  font-weight: 750;
  box-shadow: none !important;
  flex: 0 0 auto;
}

.research-page-action-sm {
  height: 34px;
  min-height: 34px;
  padding-left: .68rem !important;
  padding-right: .68rem !important;
  font-size: .76rem;
}

#refreshProjectBtn,
#refreshDocumentsBtn,
#saveReportTemplateBtn,
#createEvaluationBtn,
#addResearcherSubmit {
  min-width: 0 !important;
  width: auto !important;
  padding: 0 .82rem !important;
  align-self: auto;
}

/* Keep the hero refresh aligned with the top rather than stretched. */
#refreshProjectBtn {
  align-self: flex-start;
}

/* Avoid an oversized full-width Register Researcher action in the two-column form. */
.research-add-researcher-action {
  display: flex;
  align-items: end;
}

.research-add-researcher-action .research-page-action {
  width: 100% !important;
  max-width: 190px;
}

/* ---------------------------------------------------------
   Submitted documents + timeline
   --------------------------------------------------------- */
#teacherResearchDocuments.research-document-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#teacherResearchDocuments .research-doc-overview-card {
  overflow: hidden;
}

#teacherManuscriptTimeline {
  min-width: 0;
  overflow: hidden;
}

/* ---------------------------------------------------------
   Official report template
   --------------------------------------------------------- */
#officialReportTemplateWorkspace .research-section-head {
  align-items: start;
}

#officialReportTemplateWorkspace .research-report-template-grid {
  grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr);
  gap: 18px;
}

#officialReportTemplateWorkspace .research-report-template-settings,
#officialReportTemplateWorkspace .research-report-template-assets,
#officialReportTemplateWorkspace .research-report-asset-card {
  min-width: 0;
}

/* ---------------------------------------------------------
   Evaluation Rounds
   --------------------------------------------------------- */
#evaluationWorkspace {
  overflow: hidden;
}

.research-evaluation-round-list {
  display: grid;
  gap: 12px;
}

.research-evaluation-round-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
}

.research-evaluation-round-card.published {
  border-left: 4px solid var(--research-green);
  background: linear-gradient(90deg, #f8fff9 0%, #ffffff 22%);
}

.research-evaluation-round-card.draft {
  border-left: 4px solid var(--research-gold);
  background: linear-gradient(90deg, #fffdf3 0%, #ffffff 22%);
}

.research-evaluation-round-main {
  min-width: 0;
  overflow: hidden;
}

.research-evaluation-round-title {
  gap: .55rem;
}

.research-evaluation-round-number {
  font-size: .86rem;
}

.research-evaluation-round-card h3 {
  margin: .38rem 0 .30rem;
  font-size: 1rem;
  line-height: 1.35;
}

.research-evaluation-round-context {
  min-width: 0;
  margin: 0 0 .62rem !important;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.research-evaluation-round-context strong {
  color: var(--research-navy);
}

.research-evaluation-round-context span {
  overflow-wrap: anywhere;
}

.research-evaluation-round-meta {
  gap: .48rem .9rem;
  min-width: 0;
}

.research-evaluation-round-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Published rounds have three equal compact actions. */
.research-evaluation-round-actions {
  width: min(100%, 468px);
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(136px, 1fr));
  gap: 8px;
  align-items: center;
}

.research-evaluation-round-card.draft .research-evaluation-round-actions {
  width: 190px;
  grid-template-columns: 1fr;
}

.research-evaluation-round-actions .research-page-action {
  width: 100% !important;
  max-width: none;
}

.research-evaluation-round-actions .btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------
   Responsive behavior
   --------------------------------------------------------- */
@media (max-width: 1199.98px) {
  #teacherResearchDocuments.research-document-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-evaluation-round-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .research-evaluation-round-actions,
  .research-evaluation-round-card.draft .research-evaluation-round-actions {
    width: 100%;
  }

  .research-evaluation-round-card.published .research-evaluation-round-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .research-evaluation-round-card.draft .research-evaluation-round-actions {
    grid-template-columns: minmax(150px, 210px);
  }
}

@media (max-width: 991.98px) {
  #pageContent > .research-detail-grid {
    grid-template-columns: 1fr;
  }

  #officialReportTemplateWorkspace .research-report-template-grid {
    grid-template-columns: 1fr;
  }

  #pageContent .research-section-head {
    grid-template-columns: 1fr;
  }

  #pageContent .research-section-head > .research-page-action,
  #pageContent .research-section-head > button.research-page-action {
    justify-self: start;
  }
}

@media (max-width: 767.98px) {
  #teacherResearchDocuments.research-document-summary-grid {
    grid-template-columns: 1fr;
  }

  .research-evaluation-round-card.published .research-evaluation-round-actions,
  .research-evaluation-round-card.draft .research-evaluation-round-actions {
    grid-template-columns: 1fr;
  }

  .research-evaluation-round-actions .research-page-action {
    width: 100% !important;
  }

  #refreshProjectBtn,
  #refreshDocumentsBtn,
  #saveReportTemplateBtn,
  #createEvaluationBtn {
    width: auto !important;
  }
}

@media (max-width: 575.98px) {
  .research-page-action {
    height: 36px;
    min-height: 36px;
    font-size: .78rem;
  }

  #pageContent .research-section {
    padding: 17px;
    border-radius: 18px;
  }
}


/* =========================================================
   RESEARCH MANAGEMENT — REVISION COMPLIANCE
   ========================================================= */

.research-compliance-list {
  display: grid;
  gap: 12px;
}

.research-compliance-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--research-border);
  border-radius: 18px;
  background: #fff;
  padding: 16px 18px;
  overflow: hidden;
}

.research-compliance-card.draft {
  border-left: 4px solid var(--research-gold);
}

.research-compliance-card.submitted,
.research-compliance-card.underReview {
  border-left: 4px solid #4f6fad;
  background: linear-gradient(90deg, #f7f9ff 0%, #fff 22%);
}

.research-compliance-card.reviewed {
  border-left: 4px solid var(--research-green);
  background: linear-gradient(90deg, #f7fff9 0%, #fff 22%);
}

.research-compliance-card-main {
  min-width: 0;
}

.research-compliance-card-title {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.research-compliance-card h3 {
  margin: .38rem 0 .28rem;
  color: var(--research-navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1rem;
  line-height: 1.35;
}

.research-compliance-card p {
  margin: 0 0 .55rem;
  color: var(--research-muted);
  overflow-wrap: anywhere;
}

.research-doc-state.pending-review {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.research-compliance-card-actions {
  flex: 0 0 auto;
}

.research-compliance-card-actions .btn {
  min-width: 150px;
  white-space: nowrap;
}

.research-compliance-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .65rem;
}

.research-compliance-summary > span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .34rem .58rem;
  border: 1px solid #d6dce6;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: .76rem;
  font-weight: 700;
}

.research-compliance-summary > span.resolved {
  border-color: #b9dfc3;
  background: #f0fff4;
  color: #166534;
}

.research-compliance-summary > span.not-addressed {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.research-compliance-summary > span.outcome {
  border-color: #d8c56a;
  background: #fffdf0;
  color: var(--research-navy);
}

.research-compliance-modal-content {
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#revisionComplianceModal .modal-body,
#complianceReviewModal .modal-body {
  overflow-y: auto;
  min-height: 0;
}

#revisionComplianceModal .modal-footer,
#complianceReviewModal .modal-footer {
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid var(--research-border);
}

.research-compliance-manuscript-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, .42fr);
  gap: 14px;
  align-items: end;
}

.research-compliance-source-box,
.research-compliance-review-topbar > div {
  border: 1px solid var(--research-border);
  border-radius: 14px;
  background: #f8fafc;
  padding: .72rem .8rem;
}

.research-compliance-source-box small,
.research-compliance-source-box strong,
.research-compliance-review-topbar small,
.research-compliance-review-topbar strong {
  display: block;
}

.research-compliance-source-box small,
.research-compliance-review-topbar small {
  color: var(--research-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 750;
}

.research-compliance-source-box strong,
.research-compliance-review-topbar strong {
  color: var(--research-navy);
  margin-top: .18rem;
}

.research-compliance-responses {
  display: grid;
  gap: 14px;
}

.research-compliance-response-card {
  border: 1px solid var(--research-border);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.research-compliance-response-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.research-compliance-response-head > div {
  min-width: 0;
}

.research-compliance-response-head .research-kicker {
  display: block;
  margin-bottom: .35rem;
}

.research-compliance-original {
  border-left: 4px solid var(--research-gold);
  background: #fffdf3;
  border-radius: 0 12px 12px 0;
  padding: .72rem .8rem;
  margin-bottom: .9rem;
}

.research-compliance-original > small,
.research-compliance-student-evidence small,
.research-compliance-review-result small {
  display: block;
  color: var(--research-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .68rem;
  font-weight: 800;
  margin-bottom: .28rem;
}

.research-compliance-field {
  margin-top: .85rem;
}

.research-compliance-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .42fr);
  gap: 12px;
  margin-top: .85rem;
}

.research-compliance-review-result {
  margin-top: .9rem;
  padding: .78rem;
  border: 1px solid #c9d7ef;
  border-radius: 14px;
  background: #f8fbff;
  display: grid;
  gap: .75rem;
}

.research-compliance-decision {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .28rem .56rem;
  font-size: .72rem;
  font-weight: 800;
  border: 1px solid #d6dce6;
}

.research-compliance-decision.resolved {
  color: #166534;
  background: #f0fff4;
  border-color: #b9dfc3;
}

.research-compliance-decision.attention {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.research-compliance-review-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
}

.research-compliance-review-topbar .research-page-action {
  align-self: center;
}

.research-compliance-student-evidence {
  display: grid;
  gap: .72rem;
  padding: .8rem;
  background: #f8fafc;
  border: 1px solid var(--research-border);
  border-radius: 14px;
  margin-bottom: .9rem;
}

.research-compliance-student-evidence > div + div {
  border-top: 1px dashed #d6dce6;
  padding-top: .65rem;
}

.research-compliance-location strong {
  color: var(--research-navy);
}

.research-compliance-review-fields {
  display: grid;
  grid-template-columns: minmax(220px, .36fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.research-compliance-review-fields .research-rich-editor {
  min-height: 105px;
}

@media (max-width: 991.98px) {
  .research-compliance-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .research-compliance-card-actions .btn {
    width: 100%;
  }

  .research-compliance-manuscript-picker,
  .research-compliance-review-topbar,
  .research-compliance-review-fields {
    grid-template-columns: 1fr;
  }

  .research-compliance-review-topbar .research-page-action {
    justify-self: start;
  }
}

@media (max-width: 767.98px) {
  .research-compliance-field-grid {
    grid-template-columns: 1fr;
  }

  .research-compliance-response-head {
    flex-direction: column;
  }

  #revisionComplianceModal .modal-footer,
  #complianceReviewModal .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
  }

  #revisionComplianceModal .modal-footer .btn,
  #complianceReviewModal .modal-footer .btn {
    width: 100%;
    margin: 0;
  }
}


/* =========================================================
   RESEARCH MANAGEMENT — FINAL APPROVAL & COMPLETION
   ========================================================= */

.research-completion-workspace {
  min-width: 0;
}

.research-completion-readiness {
  border: 1px solid var(--research-border);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.research-completion-readiness-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.research-completion-check {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  border: 1px solid var(--research-border);
  border-radius: 15px;
  padding: .85rem;
  background: #f8fafc;
}

.research-completion-check > i {
  font-size: 1.2rem;
  margin-top: .05rem;
}

.research-completion-check.ready {
  border-color: #b9dfc3;
  background: #f4fff7;
}

.research-completion-check.ready > i {
  color: #15803d;
}

.research-completion-check.missing {
  border-color: #fed7aa;
  background: #fffaf2;
}

.research-completion-check.missing > i {
  color: #c2410c;
}

.research-completion-check strong,
.research-completion-check small {
  display: block;
}

.research-completion-check strong {
  color: var(--research-navy);
  font-size: .86rem;
}

.research-completion-check small {
  color: var(--research-muted);
  margin-top: .23rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.research-completion-readiness-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--research-border);
  background: #fbfcfe;
}

.research-completion-readiness-footer strong {
  display: block;
  color: var(--research-navy);
  margin-bottom: .18rem;
}

.research-completion-readiness-footer p {
  color: var(--research-muted);
  font-size: .82rem;
}

.research-completion-record {
  border: 1px solid #b9dfc3;
  border-left: 5px solid var(--research-green);
  border-radius: 18px;
  background: linear-gradient(120deg, #f3fff7 0%, #fff 40%);
  padding: 16px;
}

.research-completion-record-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.research-completion-record-head > div {
  display: flex;
  gap: .8rem;
  min-width: 0;
  align-items: flex-start;
}

.research-completion-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #e7f8ed;
  color: var(--research-green);
  font-size: 1.35rem;
}

.research-completion-record h3 {
  margin: .18rem 0 .15rem;
  color: var(--research-navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.08rem;
}

.research-completion-record-head p {
  margin: 0;
  color: var(--research-muted);
  font-size: .8rem;
}

.research-completion-record-grid,
.research-completion-evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.research-completion-evidence {
  margin-top: 0;
}

.research-completion-evidence-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  align-items: start;
  padding: .8rem;
  border: 1px solid var(--research-border);
  border-radius: 14px;
  background: #fff;
}

.research-completion-evidence-card > i {
  color: var(--research-green);
  font-size: 1.15rem;
}

.research-completion-evidence-card small,
.research-completion-evidence-card strong,
.research-completion-evidence-card span {
  display: block;
}

.research-completion-evidence-card small {
  color: var(--research-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .66rem;
  font-weight: 800;
}

.research-completion-evidence-card strong {
  color: var(--research-navy);
  margin-top: .16rem;
  font-size: .86rem;
}

.research-completion-evidence-card span {
  color: var(--research-muted);
  margin-top: .16rem;
  font-size: .76rem;
  overflow-wrap: anywhere;
}

.research-completion-note {
  margin-top: 12px;
  display: grid;
  gap: .6rem;
  border-top: 1px dashed #bfd7c7;
  padding-top: 12px;
}

.research-completion-note small,
.research-completion-note strong {
  display: block;
}

.research-completion-note small {
  color: var(--research-muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 800;
}

.research-completion-note strong,
.research-completion-note p {
  margin: .18rem 0 0;
  color: var(--research-navy);
}

.research-completion-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.research-completion-confirmations {
  display: grid;
  gap: .7rem;
}

.research-completion-confirmations .form-check {
  border: 1px solid var(--research-border);
  border-radius: 14px;
  padding: .78rem .9rem .78rem 2.25rem;
  background: #f8fafc;
}

.research-completion-confirmations .form-check-label {
  line-height: 1.4;
  font-size: .86rem;
}

@media (max-width: 991.98px) {
  .research-completion-readiness-grid,
  .research-completion-record-grid,
  .research-completion-evidence {
    grid-template-columns: 1fr;
  }

  .research-completion-readiness-footer {
    grid-template-columns: 1fr;
  }

  .research-completion-readiness-footer .research-page-action {
    justify-self: start;
  }
}

@media (max-width: 575.98px) {
  .research-completion-record-head {
    flex-direction: column;
  }

  .research-completion-document-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .research-completion-document-actions .btn {
    width: 100%;
  }
}


/* =========================================================
   RESEARCH MANAGEMENT — REPOSITORY / ARCHIVE /
   PUBLICATION MANAGEMENT
   ========================================================= */

.research-section-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.research-repository-workspace {
  min-width: 0;
}

.research-repository-onboarding,
.research-repository-record {
  border: 1px solid var(--research-border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  min-width: 0;
}

.research-repository-onboarding-head,
.research-repository-record-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.research-repository-onboarding-head > div,
.research-repository-record-head > div {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  min-width: 0;
}

.research-repository-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #fff8dd;
  color: #8a6812;
  font-size: 1.2rem;
}

.research-repository-icon.archived {
  background: #e9f7ef;
  color: var(--research-green);
}

.research-repository-onboarding h3,
.research-repository-record h3,
.research-publication-manager h3,
.research-repository-editor h3 {
  margin: .18rem 0 .22rem;
  color: var(--research-navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.02rem;
}

.research-repository-onboarding p,
.research-repository-record-head p,
.research-publication-manager .research-subsection-head p {
  margin: 0;
  color: var(--research-muted);
  font-size: .82rem;
  line-height: 1.45;
}

.research-repository-policy-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  border: 1px solid #c9d7ef;
  border-radius: 14px;
  background: #f7faff;
  padding: .75rem .85rem;
}

.research-repository-policy-note > i {
  color: #35578c;
  font-size: 1.1rem;
}

.research-repository-policy-note strong,
.research-repository-policy-note span {
  display: block;
}

.research-repository-policy-note strong {
  color: var(--research-navy);
  font-size: .82rem;
}

.research-repository-policy-note span {
  margin-top: .16rem;
  color: var(--research-muted);
  font-size: .76rem;
  line-height: 1.4;
}

.research-repository-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 14px 0;
}

.research-repository-metrics span {
  border: 1px solid var(--research-border);
  border-radius: 999px;
  background: #f8fafc;
  padding: .35rem .62rem;
  color: var(--research-muted);
  font-size: .76rem;
}

.research-repository-metrics strong {
  color: var(--research-navy);
}

.research-subsection-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.research-repository-form {
  min-width: 0;
}

.research-publication-list {
  display: grid;
  gap: 12px;
}

.research-publication-card {
  border: 1px solid var(--research-border);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.research-publication-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.research-publication-card-head > div {
  min-width: 0;
}

.research-publication-card h4 {
  margin: .24rem 0 0;
  color: var(--research-navy);
  font-size: .96rem;
  line-height: 1.38;
  font-weight: 800;
}

.research-publication-outlet {
  color: var(--research-muted);
  margin: .45rem 0 .55rem;
  font-size: .82rem;
}

.research-publication-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: .3rem .58rem;
  border: 1px solid #d6dce6;
  background: #f8fafc;
  color: #475569;
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

.research-publication-status.published {
  background: #eefbf2;
  border-color: #b8dec2;
  color: #166534;
}

.research-publication-status.accepted {
  background: #f0f7ff;
  border-color: #bfd4f4;
  color: #1d4f91;
}

.research-publication-status.active-track {
  background: #fffaf0;
  border-color: #ead89f;
  color: #7a5b10;
}

.research-publication-status.closed {
  background: #f8fafc;
  border-color: #d6dce6;
  color: #64748b;
}

.research-publication-citation {
  margin-top: .7rem;
  padding: .65rem .75rem;
  border-left: 3px solid var(--research-gold);
  background: #fffdf5;
  color: #4b5563;
  font-size: .8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.research-publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: .8rem;
}

.research-repository-abstract {
  margin-top: 14px;
  padding: .85rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--research-border);
}

.research-repository-abstract small,
.research-repository-meta-grid small {
  display: block;
  color: var(--research-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .66rem;
  font-weight: 800;
}

.research-repository-abstract p {
  margin: .3rem 0 0;
  color: #374151;
  line-height: 1.55;
  white-space: pre-wrap;
}

.research-repository-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.research-repository-meta-grid > div {
  border: 1px solid var(--research-border);
  border-radius: 13px;
  padding: .7rem .75rem;
  min-width: 0;
}

.research-repository-meta-grid strong {
  display: block;
  margin-top: .2rem;
  color: var(--research-navy);
  font-size: .82rem;
  overflow-wrap: anywhere;
}

.research-repository-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 12px;
}

.research-repository-keywords span {
  border-radius: 999px;
  padding: .28rem .52rem;
  background: #eef3f8;
  color: #425466;
  font-size: .7rem;
  font-weight: 700;
}

.research-repository-searchbar {
  display: grid;
  gap: .55rem;
}

.research-repository-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.research-repository-search-card {
  min-width: 0;
  border: 1px solid var(--research-border);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

.research-repository-search-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.research-repository-search-card h3 {
  margin: .35rem 0 0;
  color: var(--research-navy);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1rem;
  line-height: 1.4;
}

.research-repository-researchers {
  margin: .65rem 0 .45rem;
  color: #475569;
  font-size: .8rem;
}

.research-repository-snippet {
  color: var(--research-muted);
  font-size: .79rem;
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.research-repository-hero {
  background:
    linear-gradient(110deg, rgba(16, 35, 63, .98), rgba(25, 74, 67, .94));
}

@media (max-width: 991.98px) {
  .research-repository-results {
    grid-template-columns: 1fr;
  }

  .research-subsection-head {
    grid-template-columns: 1fr;
  }

  .research-section-head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .research-repository-meta-grid {
    grid-template-columns: 1fr;
  }

  .research-repository-record-head,
  .research-publication-card-head,
  .research-repository-onboarding-head {
    flex-direction: column;
  }
}
