:root {
  --ink: #222;
  --muted: #666;
  --line: #ddd;
  --panel: #fff;
  --bg: #f7f7f7;
  --stripe: #f3f3f3;
  --hover: #eef6fb;
  --accent: #1a75bb;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

.top {
  margin-bottom: 0.75rem;
}

.brand-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  margin-bottom: 0.5rem;
}

.brand {
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  font-weight: 700;
  color: #111;
  min-width: 22.5rem;
  flex: 0 1 auto;
}

@media (max-width: 720px) {
  .brand-row {
    flex-wrap: wrap;
  }

  .brand {
    min-width: 0;
  }

  .intro-row {
    flex-wrap: wrap;
  }

  .guide-links {
    justify-content: flex-start;
  }
}

.view-tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--line);
}

.view-tab {
  appearance: none;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem 0.35rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.view-tab:hover {
  color: var(--accent);
}

.view-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.4;
}

.page {
  width: min(1280px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.brand a:hover {
  color: var(--accent);
}

.intro {
  margin: 0;
  color: #345;
  max-width: 70ch;
  font-size: 0.98rem;
  line-height: 1.45;
  min-height: calc(1.45em * 2);
}

.intro-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.guide-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.9rem;
  flex: 0 0 auto;
  padding-top: 0.15rem;
}

.guide-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.guide-link:hover {
  text-decoration: underline;
}

.guide-link.is-soon {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

.guide-link.is-soon:hover {
  text-decoration: none;
}

.view-pane[hidden] {
  display: none !important;
}

.view-pane:not([hidden]) {
  animation: viewFade 0.16s ease;
}

@keyframes viewFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem 0.65rem;
  align-items: flex-end;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-x: auto;
  --tb-control-h: 2rem;
  --tb-label-h: 1rem;
  --tb-region-w: 8.6rem;
  --tb-years-w: 15.75rem;
  --tb-journals-w: 10.75rem;
  --tb-tour-w: 3.6rem;
  min-height: calc(0.55rem * 2 + var(--tb-label-h) + 0.2rem + var(--tb-control-h));
}

.tb-shared,
.tb-rest {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem 0.65rem;
  align-items: flex-end;
}

.tb-shared {
  flex: 0 0 auto;
}

.tb-rest {
  flex: 1 1 auto;
  min-width: 0;
}

.tb-region {
  width: var(--tb-region-w);
}

.tb-region select {
  width: 100%;
  min-width: 0;
}

.tb-metric select {
  width: 13.5rem;
  min-width: 0;
}

.tb-num {
  width: 6.4rem;
}

.tb-num input {
  width: 100%;
}

.tb-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  flex: 0 0 auto;
}

.tb-field > span {
  display: block;
  height: var(--tb-label-h);
  line-height: var(--tb-label-h);
}

.tb-field select,
.tb-field input:not([type="range"]):not(.year-box) {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 0 0.45rem;
  background: #fff;
  min-width: 6.5rem;
  height: var(--tb-control-h);
  box-sizing: border-box;
  line-height: 1.2;
}

.tb-field input[type="number"]:not(.year-box) {
  width: 3.6rem;
  min-width: 0;
}

.tb-num input[type="number"] {
  width: 100%;
}

.search-field {
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 240px;
}

.search-field input[type="search"] {
  width: 100%;
  min-width: 0;
}

.year-field {
  flex: 0 0 var(--tb-years-w);
  width: var(--tb-years-w);
  min-width: var(--tb-years-w);
  max-width: var(--tb-years-w);
  text-transform: none;
}

.year-field > span {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.year-range {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #e8f1f8;
  border: 1px solid #c5d8e8;
  border-radius: 3px;
  padding: 0 0.35rem;
  height: var(--tb-control-h);
  box-sizing: border-box;
}

.year-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.9rem;
  min-width: 2.9rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: 1px solid #9bb8d0;
  border-radius: 3px;
  background: #f3f8fc;
  color: #1a4f75;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.35rem;
  text-align: center;
  text-transform: none;
  cursor: text;
  appearance: textfield;
  -moz-appearance: textfield;
}

.year-box::-webkit-outer-spin-button,
.year-box::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.year-box:focus {
  outline: none;
  border-color: #6a93b3;
}

.year-slider {
  position: relative;
  flex: 1 1 auto;
  height: 1.35rem;
  display: flex;
  align-items: center;
}

.year-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 0.35rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cfd8e0;
  pointer-events: none;
}

.year-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: #3b82b0;
}

.year-slider input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
  height: 1.35rem;
}

.year-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  pointer-events: auto;
  width: 0.5rem;
  height: 1rem;
  border-radius: 2px;
  background: #1a1a1a;
  border: 0;
  cursor: pointer;
}

.year-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 0.5rem;
  height: 1rem;
  border-radius: 2px;
  background: #1a1a1a;
  border: 0;
  cursor: pointer;
}

.year-slider input[type="range"]::-webkit-slider-runnable-track {
  appearance: none;
  background: transparent;
  height: 0.35rem;
}

.year-slider input[type="range"]::-moz-range-track {
  background: transparent;
  height: 0.35rem;
  border: 0;
}

.tb-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  padding-bottom: 0.2rem;
  cursor: pointer;
}

.journals-btn,
.tour-btn {
  appearance: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.55rem;
  border-radius: 3px;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  height: var(--tb-control-h);
  box-sizing: border-box;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Match labeled fields: blank label row + control */
  margin-top: calc(var(--tb-label-h) + 0.2rem);
}

.journals-btn {
  border: 1px solid #bbb;
  background: #fff;
  color: var(--ink);
}

.journals-btn:hover,
.journals-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef6fb;
}

a.journals-btn {
  text-decoration: none;
  color: var(--ink);
}

.tour-btn {
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
}

.tb-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  margin-left: auto;
  margin-top: calc(var(--tb-label-h) + 0.2rem);
  height: var(--tb-control-h);
}

.tb-actions .journals-btn,
.tb-actions .tour-btn {
  margin-top: 0;
  margin-left: 0;
}

.tb-actions .journals-btn {
  width: var(--tb-journals-w);
  min-width: var(--tb-journals-w);
}

.tb-actions .tour-btn {
  width: var(--tb-tour-w);
  min-width: var(--tb-tour-w);
}

@media (max-width: 1100px) {
  .toolbar {
    flex-wrap: wrap;
    overflow-x: visible;
    align-items: flex-end;
    row-gap: 0.55rem;
  }

  .tb-shared,
  .tb-rest,
  .tb-actions {
    display: contents;
  }

  .year-field {
    flex: 1 1 13rem;
    width: auto;
    min-width: 12rem;
    max-width: none;
  }

  .tb-metric {
    flex: 1 1 11rem;
    min-width: 0;
  }

  .tb-metric select {
    width: 100%;
    min-width: 0;
  }

  .tb-field select,
  .tb-field input:not([type="range"]):not(.year-box) {
    min-width: 0;
  }

  .search-field {
    flex: 1 1 10rem;
    max-width: none;
  }

  .tb-actions .journals-btn {
    width: auto;
    min-width: 8.5rem;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .tb-region {
    flex: 1 1 8rem;
    width: auto;
  }

  .year-field {
    flex: 1 1 100%;
    min-width: 0;
  }

  .tb-metric {
    flex: 1 1 100%;
  }

  .tb-num {
    flex: 1 1 6rem;
    width: auto;
  }

  .search-field {
    flex: 1 1 9rem;
  }

  .tb-actions .journals-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.tour-btn:hover {
  background: #eef6fb;
}

.tour-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.tour-root.hidden {
  display: none;
}

.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 40, 55, 0.42);
  pointer-events: auto;
}

.tour-backdrop.is-clear {
  background: transparent;
}

.tour-spotlight {
  position: fixed;
  z-index: 10001;
  border-radius: 4px;
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 6px #337ab7,
    0 0 0 999vmax rgba(25, 40, 55, 0.42);
  pointer-events: none;
  background: transparent;
}

.tour-target {
  position: relative;
  z-index: 10001;
  border-radius: 4px;
}

.tour-popover {
  position: fixed;
  z-index: 10002;
  width: min(340px, calc(100vw - 1.5rem));
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  overflow: visible;
}

.tour-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #337ab7;
  color: #fff;
  border-radius: 6px 6px 0 0;
}

.tour-pop-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.tour-skip {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  opacity: 0.85;
}

.tour-skip:hover {
  opacity: 1;
}

.tour-pop-body {
  padding: 0.75rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #333;
}

.tour-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem 0.7rem;
  border-top: 1px solid #e5e5e5;
}

.tour-progress {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tour-actions {
  display: flex;
  gap: 0.4rem;
}

.tour-btn-secondary,
.tour-btn-primary {
  appearance: none;
  border-radius: 3px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}

.tour-btn-secondary {
  border: 1px solid #bbb;
  background: #fff;
  color: #444;
}

.tour-btn-secondary:disabled {
  opacity: 0.4;
  cursor: default;
}

.tour-btn-primary {
  border: 1px solid #2e6da4;
  background: #337ab7;
  color: #fff;
}

.tour-btn-primary:hover {
  background: #286090;
}

.tour-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border: 9px solid transparent;
}

.tour-arrow.top {
  top: -18px;
  border-bottom-color: #337ab7;
}

.tour-arrow.bottom {
  bottom: -18px;
  border-top-color: #fff;
}

.tour-arrow.left {
  left: -18px;
  border-right-color: #fff;
}

.tour-arrow.right {
  right: -18px;
  border-left-color: #fff;
}

.journals-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(960px, calc(100vw - 1.5rem));
  width: 100%;
}

.journals-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.journals-card {
  --venue-cols: 1.25rem 9.5rem minmax(7rem, 1fr) 2.55rem 4.4rem 4.6rem;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: min(85vh, 900px);
  overflow: hidden;
  padding: 1rem 1.1rem 0;
}

.journals-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.journals-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.journals-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  margin: 0.75rem 0 0.5rem;
}

.venues-count {
  color: var(--muted);
  font-size: 0.88rem;
  margin-left: auto;
}

.venues-tree {
  display: grid;
  gap: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 0.15rem;
  margin-bottom: 0.25rem;
}

.venue-group-title,
.venue-subgroup-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  user-select: none;
}

.venue-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.venue-group-title input,
.venue-subgroup-title input {
  flex-shrink: 0;
}

.venue-subgroup {
  margin: 0.35rem 0 0.55rem 0.15rem;
  padding-left: 0.65rem;
  border-left: 2px solid var(--line);
}

.venue-subgroup-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.venue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem 0;
}

.venue-cols-head,
.venue-row {
  display: grid;
  grid-template-columns: var(--venue-cols);
  column-gap: 0.4rem;
  align-items: start;
  padding: 0.32rem 0.2rem;
}

.venue-cols-head {
  flex-shrink: 0;
  z-index: 2;
  margin: 0 -0.2rem 0;
  padding: 0.45rem 0.4rem 0.4rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.venue-cols-head > :nth-child(n + 4) {
  justify-self: center;
  text-align: center;
}

.venue-row {
  cursor: pointer;
  font-size: 0.88rem;
  border-radius: 3px;
}

.venue-row:hover {
  background: var(--hover);
}

.venue-row > input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0.2rem 0 0;
  justify-self: center;
}

.venue-short {
  font-weight: 700;
  color: var(--accent);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.venue-name {
  color: var(--ink);
  white-space: normal;
  overflow: visible;
  line-height: 1.35;
  word-break: break-word;
}

.venue-if {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  justify-self: center;
  line-height: 1.35;
  padding-top: 0.08rem;
}

.jcr-badge,
.abdc-badge {
  display: inline-block;
  min-width: 1.85rem;
  padding: 0.06rem 0.32rem;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.35;
  justify-self: center;
}

.jcr-q1 {
  background: #d9f0d9;
  color: #1b5e20;
}

.jcr-q2 {
  background: #d6e8f8;
  color: #1a5276;
}

.jcr-q3 {
  background: #fdebd0;
  color: #9a4d00;
}

.jcr-q4 {
  background: #f5d0d0;
  color: #922b21;
}

.jcr-na,
.abdc-na {
  background: #ececec;
  color: #666;
  font-weight: 600;
}

.abdc-astar {
  background: #f3e5c8;
  color: #7a4f00;
}

.abdc-a {
  background: #d9f0d9;
  color: #1b5e20;
}

.abdc-b {
  background: #d6e8f8;
  color: #1a5276;
}

.abdc-c {
  background: #ececec;
  color: #555;
}

.journals-head,
.journals-presets,
.venue-cols-head,
.journals-foot {
  flex-shrink: 0;
}

.journals-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
  padding: 0.75rem 0 1.1rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.primary-btn {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

.primary-btn:hover {
  filter: brightness(0.95);
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.35rem 0;
  max-height: calc(100vh - 1rem);
  overflow: auto;
}

.area-row,
.domain-head,
.all-areas {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.28rem 0.7rem;
  margin: 0;
  cursor: pointer;
  font-size: 0.92rem;
}

.area-row:hover,
.domain-head:hover,
.all-areas:hover {
  background: var(--hover);
}

.all-areas {
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
  margin-bottom: 0.2rem;
}

.domain-block {
  border-left: 3px solid var(--domain);
  margin: 0.35rem 0.4rem 0.55rem;
}

.domain-head {
  font-weight: 700;
  color: var(--domain);
  padding-left: 0.55rem;
}

.domain-areas .area-row {
  padding-left: 0.9rem;
  font-size: 0.88rem;
}

.area-name,
.domain-label {
  min-width: 0;
}

.main {
  min-width: 0;
}

.table-tools {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
  align-items: center;
}

.appt-toggle {
  appearance: none;
  border: 1.5px solid #d97706;
  background: #fff8eb;
  color: #b45309;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
}

.appt-toggle:hover {
  background: #fde68a;
}

.appt-toggle.is-on {
  background: #d97706;
  color: #fff;
  border-color: #b45309;
}

.fac-toggle {
  appearance: none;
  border: 1.5px solid #0f766e;
  background: #f0fdfa;
  color: #0f766e;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
}

.fac-toggle:hover {
  background: #ccfbf1;
}

.fac-toggle.is-on {
  background: #0f766e;
  color: #fff;
  border-color: #115e59;
}

.table-expand-tools {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

body.is-faculty-view .table-expand-tools,
body.is-faculty-view [data-tour="minFaculty"] {
  display: none;
}

body.is-faculty-view .col-fac,
body.is-faculty-view th.col-fac {
  text-align: left;
  width: auto;
  min-width: 10rem;
  font-weight: 500;
  font-variant-numeric: normal;
}

body.is-faculty-view .appt-toggle,
body.is-appointment-view .fac-toggle {
  opacity: 0.45;
}

body.is-faculty-view tbody td.col-fac {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  flex-wrap: nowrap;
}

.affil-item {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
  line-height: 1.25;
}

.affil-years {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

tbody tr.fac-row {
  cursor: pointer;
}

tbody tr.fac-row:nth-child(odd) {
  background: #fff;
}

tbody tr.fac-row:nth-child(even) {
  background: var(--stripe);
}

tbody tr.fac-row:hover {
  background: var(--hover);
}

.fac-row-name {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.appt-mark {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.04rem 0.4rem;
  border-radius: 999px;
  background: #fff3d6;
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.linkish {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #444;
  background: #ececec;
}

tbody tr.inst-row:nth-child(odd of .inst-row) {
  background: #fff;
}

tbody tr.inst-row:nth-child(even of .inst-row) {
  background: var(--stripe);
}

/* striped via JS-independent fallback */
tbody tr.inst-row {
  cursor: pointer;
}

tbody tr.inst-row:hover {
  background: var(--hover);
}

tbody tr.inst-row[aria-expanded="true"] {
  background: #e3eef7;
}

.col-rank {
  width: 3.2rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.col-count,
.col-fac,
th.col-count,
th.col-fac {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 5.5rem;
}

.col-count {
  font-weight: 700;
}

.inst-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.expand-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.7rem;
  padding: 0;
  cursor: pointer;
  width: 1rem;
}

.inst-label {
  min-width: 0;
}

.flag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 0 0.25rem;
  line-height: 1.3;
}

.inst-icon {
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.75;
  color: var(--accent);
}

.inst-icon:hover {
  opacity: 1;
}

.faculty-panel td {
  background: #fafafa;
  padding: 0.35rem 0.65rem 0.65rem 1.8rem;
  border-bottom: 1px solid var(--line);
}

.faculty-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.faculty-list li {
  display: grid;
  /* Fixed rank/score tracks so digit width can't shift the title column */
  grid-template-columns: minmax(0, 1fr) 13rem 4.5ch;
  gap: 0.4rem 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
  align-items: start;
}

.faculty-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.faculty-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.fac-tag {
  display: inline-block;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: #e8eaed;
  color: #3c4043;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.modal-tags {
  margin-top: 0.4rem;
}

.faculty-list li:last-child {
  border-bottom: 0;
}

.faculty-name {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.faculty-name:hover {
  color: #0a5246;
}

.faculty-name.no-scholar {
  color: #8a8f98;
  font-weight: 600;
  text-decoration: none;
}

.faculty-name-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.no-scholar-mark {
  display: inline-block;
  padding: 0.04rem 0.4rem;
  border-radius: 999px;
  background: #eceff1;
  color: #6b7078;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}

.faculty-rank {
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  justify-self: stretch;
}

.empty {
  margin: 0;
  padding: 1.25rem;
  color: var(--muted);
}

.hidden {
  display: none;
}

.faculty-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(720px, calc(100vw - 1.5rem));
  width: 100%;
}

.faculty-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.modal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: min(82vh, 820px);
  overflow: auto;
  padding: 1rem 1.1rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-meta {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-meta a {
  color: var(--accent);
}

.modal-close {
  appearance: none;
  border: 1px solid var(--line);
  background: #f3f3f3;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-score {
  margin: 0.75rem 0;
  padding: 0.45rem 0.6rem;
  background: #e8f1f8;
  border-radius: 4px;
  font-weight: 700;
}

.modal-papers {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.modal-papers li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #eee;
}

.paper-year {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--muted);
}

.paper-title {
  font-weight: 600;
}

.paper-title a {
  margin-left: 0.3rem;
  color: var(--accent);
  font-size: 0.85rem;
}

.paper-venue {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.paper-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.25rem;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #e8f1f8;
  color: #1a4f75;
  font-size: 0.72rem;
  font-weight: 700;
}

.empty-papers {
  color: var(--muted);
  display: block !important;
  border: 0 !important;
}

.site-footer {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.site-footer p {
  margin: 0.35rem 0;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .gh-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.site-footer .gh-icon {
  display: inline-block;
  vertical-align: -0.1em;
}

.site-footer .footer-note {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: #888;
}

.doc-page {
  max-width: 760px;
  padding-bottom: 3rem;
}

.doc-top {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.doc-back {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.doc-back:hover {
  text-decoration: underline;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}

.doc-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.doc-nav a:hover,
.doc-nav a.active {
  color: var(--accent);
}

.doc-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.15rem 1.25rem 1.4rem;
}

.doc-body h1 {
  margin: 0 0 0.85rem;
  font-size: 1.55rem;
  line-height: 1.25;
}

.doc-body h2 {
  margin: 1.35rem 0 0.55rem;
  font-size: 1.15rem;
}

.doc-body h3 {
  margin: 1.1rem 0 0.4rem;
  font-size: 1.02rem;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  margin: 0.55rem 0;
}

.doc-body li {
  margin: 0.2rem 0;
}

.doc-body a {
  color: var(--accent);
}

.doc-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f0f2f4;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

.doc-body pre {
  overflow-x: auto;
  background: #f0f2f4;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 0.85rem;
}

.doc-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.92rem;
}

.doc-body th,
.doc-body td {
  border: 1px solid var(--line);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  background: var(--stripe);
}

.doc-loading,
.doc-error {
  color: var(--muted);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .faculty-list li {
    grid-template-columns: 1fr auto;
  }

  .faculty-rank {
    display: none;
  }
}

.net-check {
  height: var(--tb-control-h);
  margin-top: calc(var(--tb-label-h) + 0.2rem);
  padding-bottom: 0;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
}

.net-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 70vh;
  min-width: 0;
}

.net-stage {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 70vh;
  overflow: hidden;
}

.net-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 70vh;
}

.net-status {
  position: absolute;
  left: 0.65rem;
  bottom: 0.5rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  pointer-events: none;
}

.net-pop {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: min(340px, calc(100% - 1.3rem));
  max-height: calc(100% - 2.4rem);
  overflow: auto;
  z-index: 2;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.75rem 0.85rem 0.9rem;
}

.net-pop.hidden,
.net-pop[hidden] {
  display: none;
}

.net-pop .modal-close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
}

.net-pop h2 {
  margin: 0 1.8rem 0.25rem 0;
  font-size: 1.05rem;
}

.net-pop p {
  margin: 0 0 0.5rem;
  color: #345;
  font-size: 0.9rem;
}

.net-hint,
.net-meta {
  color: var(--muted) !important;
  font-size: 0.85rem !important;
  line-height: 1.45;
}

.net-neighbors {
  margin: 0;
  padding: 0;
  list-style: none;
}

.net-neighbors li {
  display: block;
  padding: 0.28rem 0;
  border-top: 1px solid var(--stripe);
  font-size: 0.88rem;
}

.net-coauthor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: baseline;
}

.net-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.net-neighbors button.net-name {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.net-neighbors button.net-name:hover {
  text-decoration: underline;
}

.net-papers-btn {
  appearance: none;
  border: 1px solid #bbb;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.4;
}

.net-papers-btn:hover,
.net-papers-btn.open {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef6fb;
}

.net-shared {
  margin: 0.25rem 0 0.15rem;
  padding: 0 0 0 0.1rem;
  list-style: none;
}

.net-shared.hidden {
  display: none;
}

.net-shared li {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.28rem 0 0.28rem 0.15rem;
  border-top: 1px solid var(--stripe);
}

.net-shared-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.net-shared-title {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.3;
}

@media (max-width: 860px) {
  .net-pop {
    width: calc(100% - 1.3rem);
    max-height: 40%;
  }
}
