/* content-window.css */
.markdown-source-view.mod-cm6 {
  & {
    --font-monospace-theme: 'Cascadia Mono';
    font-feature-settings: "ss01";
    --font-text: var(--font-monospace);
    --font-text-size: calc(0.75 * var(--font-text-size));
    --line-height-normal: 1.8em;
    --line-height-tight: 1.4em;
    --font-thin: 200;
    --font-extralight: 240;
    --font-light: 280;
    --font-normal: 330;
    --font-semibold: 500;
    --font-bold: 600;
    --font-extrabold: 650;
    --font-black: 700;
    --file-line-width: 80ch;
  }

  .cm-contentContainer {
    justify-content: end;
  }

  .cm-gutters {
    font-size: var(--font-text-size);
    margin: 0 2ch 0 -20ch;
    padding: 0;
    

    .cm-active {
      color: var(--background-primary);
      background-color: var(--color-base-30);
      border-radius: var(--radius-s);
    }
  }

  .cm-gutterElement {
    padding: 0 1ch 0 2ch;
    min-width: 5ch;
  }

  .cm-content {
    & > * {
      margin: 0;
      padding: 0;
    }
  }
}

.markdown-reading-view {
  & {
    --font-text-theme: 'Inter Variable';
    
    --line-height-normal: 1.8em;
    --line-height-tight: 1.4em;
    
    
    
    
    
    
    
    
    --file-line-width: 90ch;
  }

  font-variation-settings: "wght" var(--font-normal);
  font-weight: var(--font-normal);

  font-feature-settings: "ss02";
}


body {
  
  --background-secondary: var(--background-primary);
  --background-secondary-alt: var(--background-primary-alt);

  
  --ribbon-background: var(--background-primary);
  --ribbon-background-collapsed: var(--background-primary);
  
  

  
  --titlebar-background: var(--background-primary);
  --titlebar-background-focused: var(--background-primary);
  
  --titlebar-border-color: transparent;
  --titlebar-text-color: var(--text-muted);
  --titlebar-text-color-focused: var(--text-normal);
  --titlebar-text-weight: var(--font-bold);
  
  
  
  
  --tab-text-color-focused-active: var(--text-accent);
  --tab-text-color-focused-highlighted: var(--text-accent);
  --tab-text-color-focused-active-current: var(--text-accent);
  
  
  --tab-container-background: var(--background-primary);
  --tab-divider-color: transparent;
  --tab-outline-color: transparent;
  --tab-outline-width: 0;
  --tab-curve: 0;
  
  --tab-radius-active: var(--radius-s);
  
  

  
  
  
  
  --nav-item-color-active: var(--background-primary);
  
  
  --nav-item-background-hover: var(--background-primary-alt);
  --nav-item-background-active: var(--color-accent);
  
  
  
  
  
  
  
  
  
  
  --nav-indentation-guide-color: transparent;
  
  
  
  
  
  
  
  

  
  --divider-color: transparent;
  
  
  
  
}

.theme-light {
  --background-primary: #fff;
  --background-primary-alt: #eee;
  --text-normal: #444;
  --text-muted: #888;
  --text-faint: #bbb;

  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-tint-1: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 30%);
  --accent-tint-2: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 50%);
  --accent-tint-3: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 80%);
  --accent-tint-4: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 90%);
  --accent-shade-1: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 20%);
  --accent-shade-2: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 40%);
  --accent-shade-3: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 80%);
  --accent-shade-4: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 90%);
}

.theme-dark {
  --background-primary: #111;
  --background-primary-alt: #222;
  --text-normal: #bbb;
  --text-muted: #888;
  --text-faint: #666;

  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-shade-1: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 30%);
  --accent-shade-2: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 50%);
  --accent-shade-3: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 80%);
  --accent-shade-4: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 95%) 90%);
  --accent-tint-1: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 20%);
  --accent-tint-2: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 40%);
  --accent-tint-3: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 80%);
  --accent-tint-4: color-mix(in lch, var(--accent), hsl(var(--accent-h), var(--accent-s), 10%) 90%);
}


.markdown-source-view.mod-cm6 {
  & {
    --blockquote-border-thickness: 0.25ch;
    --blockquote-border-color: var(--text-accent);
    --blockquote-style: italic;
    --blockquote-font-style: italic;
    --blockquote-color: var(--text-accent);
    --blockquote-background-color: transparent;
  }

  .cm-quote {
    &.cm-em {
      font-style: normal;
    }

    &.cm-formatting-quote {
      color: var(--text-accent);
    }

    &.cm-code, &.cm-inline-code {
      font-style: normal;
    }

    &.cm-hmd-internal-link {
      --link-decoration: underline;
    }
  }

  .cm-active.HyperMD-quote::before {
    --blockquote-border-color: transparent;
  }
}

.markdown-reading-view {
  & {
    --blockquote-border-thickness: 0.25ch;
    --blockquote-border-color: var(--text-accent);
    --blockquote-style: italic;
    --blockquote-font-style: italic;
    --blockquote-color: var(--text-accent);
    --blockquote-background-color: transparent;
  }

  blockquote {
    padding: 0 0 0 1.75ch;

    em {
      font-style: normal;
    }

    code {
      font-style: normal;
    }

    a {
      --link-decoration: underline;
    }
  }
}


.markdown-source-view.mod-cm6 {
  --callout-border-width: 0 0 0 0.25ch;
  --callout-border-opacity: 1;
  --callout-padding: 0 0 0 2ch;
  --callout-radius: 0;
  --callout-blend-mode: var(--highlight-mix-blend-mode);
  --callout-title-color: inherit;
  --callout-title-padding: 0;
  --callout-title-size: inherit;
  --callout-title-weight: calc(var(--font-weight) + var(--bold-modifier));
  --callout-content-padding: 0;
  --callout-content-background: transparent;

  .cm-callout .markdown-rendered .callout {
    padding: 0 0 0 1.75ch;
    background-color: transparent;
    color: rgb(var(--callout-color));

    .callout-content {
      font-variation-settings: "wght" var(--font-normal);
      font-weight: var(--font-normal);
      overflow-wrap: break-word;

      &>* {
        margin: var(--line-height-normal) 0;
      }

      &>*:last-child {
        margin-bottom: 0;
      }

      strong,
      strong em {
        font-variation-settings: "wght" var(--font-bold);
        font-weight: var(--font-bold);
      }

      code {
        margin: 0;
        padding: 0;
      }

      ul, ol {
        li::marker {
          color: inherit;
        }
      }

      ul>li {
        --list-indent: 2ch;

        &::marker {
          content: "• ";
          font-variation-settings: "wght" var(--font-bold);
          font-weight: var(--font-bold);
        }

        &>ul>li {
          --list-indent: 4ch;
        }
      }

      ol {
        list-style-position: inside;

        li {
          --list-indent: 0;

          &>ol>li {
            --list-indent: 4ch;
          }
        }
      }
    }

    .callout-title {
      line-height: var(--line-height-normal);
      font-variation-settings: "wght" var(--font-semibold);
      font-weight: var(--font-semibold);

      gap: 1ch;

      .svg-icon {
        height: 2ch;
        width: 2ch;
        stroke-width: 2.5px;
      }
    }
  }
}

.markdown-reading-view {
  --callout-border-width: 0 0 0 0.25ch;
  --callout-border-opacity: 1;
  --callout-padding: 0 0 0 2ch;
  --callout-radius: 0;
  --callout-blend-mode: var(--highlight-mix-blend-mode);
  --callout-title-color: inherit;
  --callout-title-padding: 0;
  --callout-title-size: inherit;
  --callout-title-weight: calc(var(--font-weight) + var(--bold-modifier));
  --callout-content-padding: 0;
  --callout-content-background: transparent;

  .callout {
    padding: 0 0 0 1.75ch;
    background-color: transparent;
    color: rgb(var(--callout-color));

    .callout-content>*:last-child {
      margin-bottom: 0;
    }

    .callout-title {
      line-height: var(--line-height-normal);
      font-variation-settings: "wght" var(--font-semibold);
      font-weight: var(--font-semibold);

      gap: 1ch;

      .svg-icon {
        height: 2ch;
        width: 2ch;
        stroke-width: 2.5px;
      }
    }
  }
}


.theme-light {
  --code-background: #f8f8f8;
  --code-background-inline: #f2f2f2;
  --code-normal: #5c6166;
  --code-comment: #787b8088;
  --code-function: #f2ae49;
  --code-important: #e6ba7e;
  --code-keyword: #fa8d3e;
  --code-operator: #ed9366;
  --code-property: #399ee6;
  --code-punctuation: #5c6166;
  --code-string: #86b300;
  --code-tag: #55b4d4;
  --code-value: #a37acc;
}

.theme-dark {
  --code-background: #242936;
  --code-background-inline: #242936;
  --code-normal: #cccac2;
  --code-comment: #b8cfe688;
  --code-function: #ffd173;
  --code-important: #ffdfb3;
  --code-keyword: #ffad66;
  --code-operator: #f29e74;
  --code-property: #73d0ff;
  --code-punctuation: #cccac2;
  --code-string: #d5ff80;
  --code-tag: #5ccfe6;
  --code-value: #dfbfff;
}

.markdown-source-view.mod-cm6 {
  & {
    --code-size: var(--font-text-size);
    --code-radius: 0;
  }

  .cm-inline-code {
    background-color: var(--code-background-inline);
    padding: 0;

    .cm-formatting {
      color: var(--text-faint);
      padding: 0;
    }

    &.cm-formatting ~ &:not(.cm-formatting) {
      padding: 0;
    }
  }
  
  .cm-line:has(> .cm-hmd-indented-code) {
    background-color: var(--code-background);

    .cm-hmd-indented-code {
      background-color: transparent;
    }
  }

  .cm-line.HyperMD-codeblock {
    padding: 0;
  }
}

.markdown-reading-view {

  & {
    --code-size: var(--font-smallest);
  }

  pre {
    position: relative;
    padding: 1.5ch;
    min-height: unset;
    background-color: var(--code-background);
    border-radius: calc(var(--code-radius) * 2);
    white-space: var(--code-white-space);
    overflow-x: auto;

    code {
      background-color: transparent;
      padding: 0;
    }
  }

  code {
    background-color: var(--code-background-inline);
  }
}


.markdown-source-view {
  .cm-comment {
    font-style: italic;
  }
}


.markdown-source-view {
  .cm-strong {
    font-variation-settings: "wght" var(--font-bold);
    font-weight: var(--font-bold);
  }

  .cm-strong,
  .cm-em,
  .cm-strikethrough,
  .cm-highlight {
    &.cm-formatting {
      color: var(--text-faint);
    }
  }
}

.markdown-reading-view {
  strong {
    font-variation-settings: "wght" var(--font-bold);
    font-weight: var(--font-bold);
  }
}


.markdown-source-view {
  & {
    --footnote-size: var(--font-text-size);
  }

  span.cm-footref,
  span.cm-blockid {
    font-size: var(--footnote-size);
    vertical-align: unset;
    top: 0;
    margin: 0;
  }

  span.cm-hmd-footnote {
    font-size: var(--footnote-size);
    top: 0;
  }

  .cm-line.HyperMD-footnote span.cm-hmd-footnote {
    cursor: text;
    display: inline-block;
    font-size: var(--footnote-size);
    position: relative;
    top: 0;
    color: var(--text-muted);
  }
}


.markdown-source-view.mod-cm6 {
  & {
    --h1-size: var(--font-text-size);
    --h2-size: var(--font-text-size);
    --h3-size: var(--font-text-size);
    --h4-size: var(--font-text-size);
    --h5-size: var(--font-text-size);
    --h6-size: var(--font-text-size);
    --h1-line-height: var(--line-height-normal);
    --h2-line-height: var(--line-height-normal);
    --h3-line-height: var(--line-height-normal);
    --h4-line-height: var(--line-height-normal);
    --h5-line-height: var(--line-height-normal);
    --h6-line-height: var(--line-height-normal);
    --h1-weight: var(--font-extrabold);





    --h1-style: normal;
    --h2-style: normal;
    --h3-style: normal;
    --h4-style: normal;
    --h5-style: normal;
    --h6-style: italic;
  }

  .cm-header {
    font-variation-settings: "wght" var(--h1-weight);
    font-weight: var(--h1-weight);
    padding: 0;
    margin: 0;
    letter-spacing: 0;
  }

  .cm-formatting-header {
    color: var(--text-normal);
  }
}

.markdown-reading-view {
  & {
    --h1-size: 2em;
    --h2-size: 1.5em;
    --h3-size: 1.25em;
    --h4-size: var(--font-text-size);
    --h5-size: var(--font-text-size);
    --h6-size: var(--font-text-size);
    --h1-line-height: var(--line-height-normal);
    --h2-line-height: var(--line-height-normal);
    --h3-line-height: var(--line-height-normal);
    --h4-line-height: var(--line-height-normal);
    --h5-line-height: var(--line-height-normal);
    --h6-line-height: var(--line-height-normal);
    --h1-weight: var(--font-bold);
    --h2-weight: var(--h1-weight);
    --h3-weight: var(--h1-weight);
    --h4-weight: var(--h1-weight);
    --h5-weight: var(--font-semibold);
    --h6-weight: var(--font-semibold);
    --h1-style: normal;
    --h2-style: normal;
    --h3-style: normal;
    --h4-style: normal;
    --h5-style: normal;
    --h6-style: italic;

    --heading-spacing: 1em;
  }

  h1 {
    font-variation-settings: "wght" var(--h1-weight);
    font-weight: var(--h1-weight);
  }
  h2 {
    font-variation-settings: "wght" var(--h2-weight);
    font-weight: var(--h2-weight);
  }
  h3 {
    font-variation-settings: "wght" var(--h3-weight);
    font-weight: var(--h3-weight);
  }
  h4 {
    font-variation-settings: "wght" var(--h4-weight);
    font-weight: var(--h4-weight);
  }
  h5 {
    font-variation-settings: "wght" var(--h5-weight);
    font-weight: var(--h5-weight);
  }
  h6 {
    font-variation-settings: "wght" var(--h6-weight);
    font-weight: var(--h6-weight);
  }

  h1, h2, h3, h4, h5, h6 {
    padding: 0;
    margin: 0;

    * + &,
    div + div > & {
      margin-top: var(--heading-spacing);
    }
  }

  h1, h2 {
    --heading-spacing: 2em;
  }

  div:has(h3, h4, h5, h6) + div > *, :is(h3, h4, h5, h6) + * {
    margin-top: 0;
  }
}


.markdown-source-view.mod-cm6 {
  & {
    --inline-title-color: var(--h1-color);
    --inline-title-font: var(--h1-font);
    --inline-title-line-height: var(--h1-line-height);
    --inline-title-size: var(--h1-size);
    --inline-title-style: var(--h1-style);
    --inline-title-variant: var(--h1-variant);
    --inline-title-weight: var(--h1-weight);
    --inline-title-margin-bottom: var(--line-height-normal);
  }

  .inline-title {
    font-variation-settings: "wght" var(--inline-title-weight);
    letter-spacing: 0;

    

    &::after {
      content: ".md";
      color: var(--text-faint);
    }
  }
}

.markdown-reading-view {
  & {
    --inline-title-color: var(--h1-color);
    --inline-title-font: var(--h1-font);
    --inline-title-line-height: var(--h1-line-height);
    --inline-title-size: var(--h1-size);
    --inline-title-style: var(--h1-style);
    --inline-title-variant: var(--h1-variant);
    --inline-title-weight: var(--h1-weight);
    --inline-title-margin-bottom: var(--p-spacing);
  }

  .inline-title {
    font-variation-settings: "wght" var(--inline-title-weight);
    letter-spacing: 0;
  }
}


.markdown-source-view {
  & {
    --link-color: var(--text-accent);
    --link-color-hover: var(--text-accent);
    --link-decoration: none;
    --link-decoration-hover: underline;
    --link-decoration-thickness: auto;
    --link-weight: var(--font-weight);
    --link-external-color: var(--color-cyan);
    --link-external-color-hover: var(--color-cyan);
    --link-external-decoration: none;
    --link-external-decoration-hover: underline;
    --link-external-filter: none;
    --link-unresolved-color: var(--color-red);
    --link-unresolved-opacity: 0.5;
    --link-unresolved-filter: none;
    --link-unresolved-decoration-style: unset;
    --link-unresolved-decoration-color: var(--color-red);
  }

  .cm-hmd-internal-link {
    .is-unresolved:hover {
      opacity: 1;
      color: var(--link-unresolved-color);
      text-decoration-color: var(--link-unresolved-color);
      text-decoration-line: var(--link-decoration-hover);
    }
  }

  .external-link {
    background-image: none;
    background-size: 0;
    padding-inline-end: 0;
    background-position-y: 0;
  }
}

.markdown-reading-view {
  & {
    --link-color: var(--text-accent);
    --link-color-hover: var(--text-accent-hover);
    --link-decoration: none;
    --link-decoration-hover: underline;
    --link-decoration-thickness: auto;
    --link-weight: var(--font-weight);
    --link-external-color: var(--color-cyan);
    --link-external-color-hover: var(--color-cyan);
    --link-external-decoration: none;
    --link-external-decoration-hover: underline;
    --link-external-filter: none;
    --link-unresolved-color: var(--color-red);
    --link-unresolved-opacity: 0.5;
    --link-unresolved-filter: none;
    --link-unresolved-decoration-style: unset;
    --link-unresolved-decoration-color: var(--color-red);
  }

  .internal-link {
    transition: none;

    &.is-unresolved:hover {
      opacity: 1;
      color: var(--link-unresolved-color);
      text-decoration-color: var(--link-unresolved-color);
      text-decoration-line: var(--link-decoration-hover);
    }
  }

  .external-link {
    background-position-y: 2px;
  }
}


.markdown-source-view {
  & {
    --list-indent: 2.25em;
    --list-indent-editing: 0;
    --list-indent-source: 0;
    --list-spacing: 0;
    --list-marker-color: var(--text-normal);
    --list-marker-color-hover: var(--text-normal);
    --list-marker-color-collapsed: var(--text-accent);
    --list-bullet-border: none;
    --list-bullet-radius: 50%;
    --list-bullet-size: 0.3em;
    --list-bullet-transform: none;
    --list-numbered-style: decimal;
    --list-bullet-end-padding: 0;
  }

  .list-bullet {
    color: var(--list-marker-color);

    &::after {
      display: none;
    }
  }

  .HyperMD-list-line {
    .cm-fold-indicator {
      inset-inline-end: 2ch;
    }
  }
}

.markdown-reading-view {
  & {
    --list-indent: 2.25em;
    --list-indent-editing: 0;
    --list-indent-source: 0;
    --list-spacing: 0;
    --list-marker-color: var(--text-normal);
    --list-marker-color-hover: var(--text-normal);
    --list-marker-color-collapsed: var(--text-accent);
    --list-bullet-border: none;
    --list-bullet-radius: 50%;
    --list-bullet-size: 0.3em;
    --list-bullet-transform: none;
    --list-numbered-style: decimal;
    --list-bullet-end-padding: 0;
  }

  li::marker {
    color: inherit;
  }
}
.markdown-source-view {
  .cm-line {
    font-variation-settings: "wght" var(--font-normal);
    font-weight: var(--font-normal);
  }
}

.markdown-reading-view {
  p {
    font-variation-settings: "wght" var(--font-normal);
    font-weight: var(--font-normal);
  }
}


.markdown-source-view.mod-cm6 {
  .cm-table-widget {
    margin: 0 !important;
  }
}

.markdown-reading-view {
  table {
    width: 100%;
  }
}


.markdown-source-view {
  & {
    --citation-color: var(--color-cyan);
  }

  .pandoc-citation {
    color: var(--citation-color);
  }

  .cm-pandoc-citation {
    .cm-link:has(&) {
      --link-external-color: var(--link-unresolved-color);
      --link-external-color-hover: var(--link-unresolved-color);
    }

    .cm-link:has(&.is-resolved) {
      --link-external-color: var(--citation-color);
      --link-external-color-hover: var(--citation-color);
    }

    &.pandoc-citation {
      color: inherit;
    }
  }
}

.markdown-reading-view {
  & {
    --citation-color: var(--color-cyan);
  }

  .pandoc-citation {
    color: var(--citation-color);
  }
}

.pwc-reference-list .csl-entry-wrapper:not(:last-child) {
  border-bottom: none;
}

