* {
  margin: 0;
  padding: 0;
}

[data-viewtype="source-file"] {
  --source-line: 1px solid rgba(0, 0, 0, .05);
}

/* SDOC-NODE in SOURCE */

.source-file__requirement {
  position: static;
  padding: var(--base-padding);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  margin: 1rem 0 0 0;
  transition: background-color 0.3s ease-in, border-color 0.3s ease-in;
  font-size: var(--font-size-xsm);
}

.source-file__requirement.active {
  background-color: var(--color-bg-contrast);
  border: 1px solid var(--color-fg-contrast);
}

[data-viewtype="source-file"] .requirement_file li {
  position: relative;
}

[data-viewtype="source-file"] .requirement_file li > a,
[data-viewtype="source-file"] .requirement_file li > span {
  display: inline-block;
  padding: .15rem .25rem .15rem 0;
  line-height: 1;
}

.source-file__refer .pointer.active {
  background-color: var(--color-highlight);
}

.reset_range_highlight {
  position: absolute;
  top: 0;
  right: 0;
  width: 1rem;
  height: 1rem;
  background-color: var(--color-highlight);
  justify-content: center;
  align-items: center;
  text-decoration: none !important;
  padding: 0 !important;
  display: none !important;
}

.reset_range_highlight::before {
  content: '\2715';
}

.pointer.active + .reset_range_highlight {
  display: flex !important;
}

[data-viewtype="source-file"] .current_file_pseudolink {
  font-weight: bold;
  color: #808080;
}

/* REQS */

.source-file__refer > * {
  margin-bottom: 3rem;
}

.source-file__refer summary {
  display: block;
  padding: var(--base-padding);
  background-color: #fff;
  color: var(--color-accent);;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 2rem;
  font-size: 0.85rem;
}

.source-file__refer summary::-webkit-details-marker {
  display: none;
}

.source-file__refer summary::before {
  /* content: '⊕'; */
  content: '\25B6';
  text-align: right;
  line-height: 1;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
}

.source-file__refer details[open] > summary::before {
  /* content: '⊖'; */
  content: '\25BC';
}

.source-file__toggle-switch:not(:empty) {
  margin-bottom: 1rem;
}

/* CODE */

.source-file__source {
  /* position: relative; */
  padding: 66px 0;
  transition: box-shadow 0.3s ease-in;

  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  /* inset: 0px; */
  overflow: auto;
}

.source {
  display: grid;
  grid-template-columns:
    minmax(min-content, max-content)
    minmax(0, 1fr); /* issue#1370 https://css-tricks.com/preventing-a-grid-blowout/ */
  gap: 0 0;
  place-items: stretch stretch;
  transition: transform 0.3s ease-in;
  position: relative;

  font-size: 14px;
  z-index: 1;

  border-top: var(--source-line);
}

.source_highlight {
  position: absolute;
  left: 0;
  right: 0;
  background-color: var(--color-highlight);
  z-index: -1;
  transition: height 0.3s ease-in, top 0.3s ease-in;
}

.source__line-number {
  grid-column: 1 / 2;
  padding: 0.25rem 2rem;
  text-align: right;
  border-bottom: var(--source-line);
}

.source__line-content {
  grid-column: 2 / 3;
  padding: 0.25rem 1rem 0.25rem .5rem;
  border-bottom: var(--source-line);
  border-left: var(--source-line);
}

.sdoc-comment {
  font-style: normal;
  color: rgba(0, 0, 0, .4);
}

.sdoc-comment .pointer {
  /* user-select: none; */
  color: inherit;
  text-decoration: none;
  display: inline-block;
  /* font-size: 0.85em; */
  padding: 0 4px;
  font-style: normal;
  border: 1px solid;
  border-radius: 2px;
  transition: background-color 0.3s ease-in, border-color 0.3s ease-in;
}

.sdoc-comment .pointer:hover {
  border-color: #000;
}

.sdoc-comment .pointer.active {
  border-color: #000;
  background-color: #fff;
  color: #000;
}

/* Pygments */

.highlight {
  background: transparent !important;
}
