:root {
  --term-link: #2563a8;
  --term-ink: #15171a;
  --term-muted: #60656d;
  --term-line: #d9dde3;
  --term-paper: #ffffff;
}

.storage-hub-item.storage-hub-terms {
  grid-column: 1 / -1;
}

html body.study-home-active #appRoot .storage-hub-terms {
  grid-column: 1 / -1 !important;
}

html body.storage-library-active #appRoot .storage-library-tabs {
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

html body.storage-library-active #appRoot #storageLibraryScreen.terms-tab-active #storageLibraryFilters,
html body.storage-library-active #appRoot #storageLibraryScreen.terms-tab-active .storage-library-filters {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.terms-library {
  width: min(100%, 840px);
  margin: 0 auto;
  color: var(--term-ink);
}

html body.storage-library-active #appRoot #storageLibraryScreen.terms-tab-active #termsPanel {
  padding-top: 8px !important;
  transform: none !important;
}

.terms-library-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 15px;
  border-bottom: 1px solid var(--term-line);
}

.terms-library-head h2,
.terms-section-head h2 {
  margin: 0;
  color: #111315;
  font-size: clamp(19px, 2.4vw, 22px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.terms-library-head > span,
.terms-section-head > span {
  color: var(--term-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.terms-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--term-line);
}

.terms-toc-item {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  padding: 14px 12px;
  border: 0;
  border-bottom: 1px solid #e8eaed;
  background: transparent;
  color: var(--term-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.terms-toc-item:nth-child(odd) {
  border-right: 1px solid #e8eaed;
}

.terms-toc-item:hover,
.terms-toc-item:focus-visible {
  background: #f6f7f8;
  outline: none;
}

.terms-toc-item span {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -.012em;
  word-break: keep-all;
}

.terms-toc-item small {
  color: var(--term-muted);
  font-size: 11px;
  line-height: 1.4;
}

.terms-section-head {
  padding: 2px 2px 13px;
  border-bottom: 1px solid var(--term-line);
}

.terms-section-head h2 {
  margin-top: 10px;
}

.terms-section-head > span {
  display: block;
  margin-top: 5px;
}

.terms-toc-back {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: #555b63;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.terms-toc-back:hover,
.terms-toc-back:focus-visible {
  color: #111315;
  outline: none;
}

.terms-topic-list {
  border-bottom: 1px solid var(--term-line);
}

.terms-topic {
  border-top: 1px solid var(--term-line);
}

.terms-topic:first-child {
  border-top: 0;
}

.terms-topic > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 3px;
  color: #181b1f;
  cursor: pointer;
  list-style: none;
}

.terms-topic > summary::-webkit-details-marker {
  display: none;
}

.terms-topic > summary::after {
  content: "+";
  order: 3;
  color: #737880;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.terms-topic[open] > summary::after {
  content: "−";
}

.terms-topic > summary span {
  flex: 1;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.terms-topic > summary small {
  color: var(--term-muted);
  font-size: 11px;
  font-weight: 700;
}

.terms-topic-entries {
  padding: 0 15px;
  border-top: 1px solid #e8eaed;
  background: #fbfbfc;
}

.terms-thinker-group + .terms-thinker-group {
  border-top: 1px solid var(--term-line);
}

.terms-thinker-title {
  margin: 0;
  padding: 12px 2px 4px;
  color: #4f555d;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
}

.terms-index-meta {
  padding: 13px 2px 7px;
  color: var(--term-muted);
  font-size: 12px;
  font-weight: 750;
}

.terms-index-list {
  display: grid;
  gap: 0;
}

.term-entry {
  padding: 14px 2px 16px;
  border-bottom: 1px solid var(--term-line);
}

.terms-topic-entries .term-entry:last-child {
  border-bottom: 0;
}

.term-entry-category {
  margin-bottom: 6px;
  color: #737880;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}

.term-entry h3 {
  position: relative;
  margin: 0;
  padding-left: 11px;
  color: #111315;
  font-family: inherit;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.025em;
}

.term-entry h3::before {
  content: "";
  position: absolute;
  top: .12em;
  bottom: .12em;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: #8d939b;
}

.term-entry-aliases {
  margin-top: 7px;
  color: var(--term-muted);
  font-size: 12px;
  line-height: 1.55;
}

.term-entry-description {
  margin-top: 7px;
  color: #292d32;
  font-size: 14px;
  line-height: 1.68;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.term-entry-note {
  display: grid;
  grid-template-columns: minmax(74px, auto) 1fr;
  gap: 10px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #e7e9ec;
  color: #4a5057;
  font-size: 13px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.term-entry-note strong,
.term-entry-aliases strong {
  color: #34383e;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.term-entry-academic {
  color: #555b63;
}

.term-link {
  display: inline;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--term-link) 32%, transparent);
  color: var(--term-link);
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
  text-align: inherit;
  text-decoration: none;
  vertical-align: baseline;
  cursor: pointer;
}

.term-link:hover,
.term-link:focus-visible {
  color: #174f88;
  border-bottom-color: currentColor;
  outline: none;
}

.term-popover {
  position: fixed;
  z-index: 225000;
  width: min(296px, calc(100vw - 24px));
  max-height: min(304px, calc(100vh - 32px));
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px 13px 13px;
  border: 1px solid #cfd4da;
  border-radius: 10px;
  background: var(--term-paper);
  color: var(--term-ink);
  box-shadow: 0 12px 34px rgba(20, 27, 38, .18);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .12s ease, transform .12s ease;
}

.term-popover.show {
  opacity: 1;
  transform: translateY(0);
}

.term-popover::before,
.term-popover::after {
  content: "";
  position: absolute;
  left: var(--term-arrow-left, 28px);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

.term-popover[data-side="bottom"]::before {
  top: -8px;
  border-bottom: 8px solid #cfd4da;
}

.term-popover[data-side="bottom"]::after {
  top: -7px;
  border-bottom: 8px solid #fff;
}

.term-popover[data-side="top"]::before {
  bottom: -8px;
  border-top: 8px solid #cfd4da;
}

.term-popover[data-side="top"]::after {
  bottom: -7px;
  border-top: 8px solid #fff;
}

.term-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.term-popover-title {
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.term-popover-close {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  margin: -5px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f1f3;
  color: #4d5258;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.term-popover-sections {
  margin-top: 8px;
}

.term-popover-section {
  padding: 9px 0 0;
  border-top: 1px solid #e4e7eb;
}

.term-popover-section + .term-popover-section {
  margin-top: 9px;
}

.term-popover-section h4 {
  margin: 0 0 4px;
  color: #626870;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.35;
  letter-spacing: .01em;
}

.term-popover-section > div {
  margin: 0;
  color: #34383d;
  font-size: 13px;
  line-height: 1.66;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.term-popover-aliases > div {
  color: #50565e;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .storage-hub-item.storage-hub-terms {
    grid-column: 1 / -1;
  }

  .terms-toc {
    grid-template-columns: 1fr;
  }

  .terms-toc-item:nth-child(odd) {
    border-right: 0;
  }

  .terms-toc-item {
    padding: 13px 4px;
  }

  .terms-topic-entries {
    margin: 0 -1px;
    padding: 0 8px;
  }

  .term-entry {
    padding: 13px 1px 15px;
  }

  html body.storage-library-active #appRoot #storageLibraryScreen.terms-tab-active #termsPanel {
    padding-top: 6px !important;
  }

  .term-entry-description {
    font-size: 13.5px;
    line-height: 1.74;
  }

  .term-entry-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .term-popover {
    width: min(286px, calc(100vw - 20px));
    max-height: min(292px, calc(100vh - 24px));
    padding: 12px 13px 13px;
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .term-popover {
    transition: none;
  }
}
