:root {
  --c-border: #ccc;
  --c-background: #f0f0f0;
  --c-backgroundHead: #eee;
  --c-numbering: #888;
  --c-line0: #f9f9f9;
  --c-line1: #ffffff;
  --c-tabLine0: rgba(0, 0, 0, 0);
  --c-tabLine1: var(--c-background);
  --c-anchorHover: #000;
  --c-anchorColor: #767676;
  --c-contentPaneColor: white;
  --c-wordFound: yellow;
  --font: sans-serif;
  --c-usernoteBackground: rgba(0,0,0,0.05);
}

.sronly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toolbar {
  background: var(--c-border);
}

.code-toolbar .toolbar {
  background: unset;
}

.btn-select {
  position: relative;
  display: inline-block;
  width: 1.2em;
  height: 1.0em;
  margin: 0.5em;
}

.btn-select select {
  appearance: none;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  font-size: 1em;
  text-align: center;
  background-color: var(--c-border);
  cursor: pointer;
  opacity: 0;
}

.btn-select::before {
  content: attr(data-icon);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9em;
  pointer-events: none;
}

.btn-select::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7em;
  pointer-events: none;
}

.cursorAddon {
  position: absolute;
  pointer-events: none;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 9999;
}

.usernote {
  background-color: var(--c-usernoteBackground);
  mix-blend-mode: multiply;
}

@keyframes flash {
  0%   { background-color: var(--c-wordFound) }
  100% { background-color: transparent; }
}

.act-flash {
  animation: flash 1.5s ease-out;
}

.wordFound {
  background-color: var(--c-wordFound);
  color: var(--c-wordFound-F);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
}

h1 {
  margin: 0;
}

.splash {
  height: 100vh;
  padding: 1em;
  background: var(--c-background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  overflow: hidden;
  max-height: 100%;
}

.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--c-background);
  overflow-y: auto;
  border-left: 1px solid var(--c-border);
  position: relative;
  opacity: 1;
  transition: width 1.0s ease, opacity 1.0s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.hidden {
  width: 0;
  opacity: 0;
}

.notransition {
  transition: none;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.header {
  background: var(--c-backgroundHead);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--c-border);
}

.pnl-btn {
  background: var(--c-border);
  border: none;
  padding: 5px 10px;
  cursor: pointer;
}

.content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 1em;
  font-size: 1em;
  background-color: var(--c-contentPaneColor);
  word-break: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.tree {
  padding-top: 8px;
}

ul.tree,
ul.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0.8em;
}

ul.tree li {
  margin: 0.2em 0;
}

ul.tree summary {
  display: block;
  cursor: pointer;
}

ul.tree summary::-webkit-details-marker {
  display: none;
}

ul.tree details > summary::before {
  content: "\25B6";

  display: inline-block;
  margin-right: 5px;
}

ul.tree details[open] > summary::before {
  transform: rotate(90deg);
}

.langLink {
  font-size: 2em;
}

@media (max-width: 635px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    min-height: 60px;
    display: block;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  .main {
    width: 100%;
  }
}

@media (min-width: 1000px) {
  .sidebar.too-wide + .main {
    flex-basis: 100%;
    width: 100%;
  }
}

.hidden {
  display: none;
}

/*S: markdown formatting*/
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
    margin-top: var(--base-size-24);
    margin-bottom: var(--base-size-16);
    font-weight: var(--base-text-weight-semibold, 600);
    line-height: 1.25;
}

.content h1 {
    padding-bottom: .3em;
    font-size: 2em;
    border-bottom: 1px solid var(--c-border, var(--c-border));
}

.content h2 {
    padding-bottom: .3em;
    font-size: 1.5em;
    border-bottom: 1px solid var(--c-border, var(--c-border));
}

.content li {
    margin-top: .5em;
}

.content pre {
    display: block;
    padding: 9.5px;
    margin: 0 0 10px;
    line-height: 1.42857143;
    word-break: break-all;
    word-wrap: break-word;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    overflow: auto;
}

.content table {
    max-width: 100%;
    overflow: auto;
    font-variant: tabular-nums;
    margin: 1em 0em 1em 0em;
    width: 100%;
    border-collapse: collapse;
}

.content table tr:nth-child(even) {
    background-color: var(--c-tabLine1);
}

.content table tr:nth-child(odd) {
    background-color: var(--c-tabLine0);
}

.content table th {
    border: 1px solid var(--c-border);
    padding: 6px 13px;
}

.content table td {
    border: 1px solid var(--c-border);
    padding: 6px 13px;
}

pre code.language-mermaid, pre:has(> code.language-mermaid) {
  display: none;
}
/*E: markdown formatting*/

/*S: anchors in headings*/
.anchor-link {
  text-decoration: none;
  color: var(--c-anchorColor);
  font-weight: normal;
  margin-left: 0.25em;
  font-size: 0.8em;
}

.anchor-link:hover {
  color: var(--c-anchorHover);
}
/*E: anchors in headings*/

li:has(input[type="checkbox"]) {
  list-style-type: none;
}

ul:has(li input[type="checkbox"]) {
  padding-left: 1em;
}

#toolbar, .toolbar {
  display: flex;
  align-items: stretch;
  gap: 0.1rem;
}

#toolbar {
  display: unset;
}

#toolbar button, .toolbar button {
  flex: 1 1 auto;
  max-height: 2rem;
  line-height: 1.5;
  overflow: hidden;
}

.toolbar-down {
  margin-top: auto;
  gap: 0;
  background-color: var(--c-border);
}

.multi-linePanel {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

.toolbar-down > * {
  flex: 0 0 calc(20%);
  box-sizing: border-box;
}

.sidebar-page {
  overflow-y: auto;
  flex: 1;
}

#toolbar button, .toolbar button, .pnl-btn {
  margin: 0px;
}

.sidebar.too-wide .sidebar-page, .sidebar.too-wide .toolbar-down button, .too-wide {
  font-size: calc(1em * 1.3);
}

.too-wide .toolbar-down > * {
  box-sizing: unset;
  padding: 15px 10px;
}

.inGray {
  filter: grayscale(100%);
}

.inBlackWhite {
  filter: grayscale(100%) contrast(200%);
  --c-wordFound: black;
  --c-wordFound-F: white;
  --c-border: white;
}

.inStandard {
}

.inBWDuoColor {
  background: black;
  color: white !important;
  --c-background: black;
  --c-backgroundHead: black;
  --c-tabLine1: black;
  --c-border: black;
  --c-anchorHover: white;
  --c-contentPaneColor: black;
  --c-line0: transparent;
  --c-line1: transparent;
  --c-wordFound: white;
  --c-wordFound-F: black;
}

.inBWDuoColor .token, .inBWDuoColor code[class*=language-], .token operator {
  color: white !important;
  background-color: unset;
}

.inBWDuoColor a {
  color: white;
}

.inBWDuoColor .pnl-btn {
  color: white;
}

.inBWDuoColor svg {
  filter: grayscale(100%) contrast(200%);
}

.inBWDuoColor path {
  stroke: white !important;
}

.inBWDuoColor .toolbar-down {
  filter: grayscale(100%) contrast(200%);
}

.inBWDuoColor .usernote {
  mix-blend-mode: unset;
}

.inSepia {
  filter: sepia(0.7);
}

.treepic {
    padding-right: 0.3em;
}

.sidebar input {
  width: 100%;
  box-sizing: border-box;
  font-size: 1.15em;
}

.toright {
  flex-direction: row-reverse;
}

.toright .sidebar {
  border-left: unset;
  border-right: 1px solid var(--c-border);
}

.bottomPanel {
  border-bottom: unset;
  border-top: 1px solid var(--c-border);
}

/*S: print support*/
@media print {
  .toolbar {
    display: none !important;
  }
  
  .inSepia {
    filter: sepia(0);
  }

  body * {
    visibility: hidden;
    color: black !important;
    --c-wordFound-F: black;
  }

  .main, .main * {
    visibility: visible;
  }

  .main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  a {
    color: black;
  }
  
  .header {
    background-color: transparent;
  }
  
  button, .anchor-link {
    display: none !important;
  }
  
  svg {
    filter: grayscale(100%);
  }

  .too-wide {
    font-size: calc(1em);
  }
  
  .page-break {
    page-break-before: always;
    break-before: page;
  }

  .hiddenprint {
    display: none;
  }
}
/*E: print support*/
