.markdown-content {
  // Base styles for markdown content
  line-height: 1.5;
  word-wrap: break-word;
  white-space: normal !important; // override container pre-wrap
  

  ul {   
    padding-left: 1.625em !important;
    margin-top: 0.75em !important;
    margin-bottom: 0.75em !important;

    li {
      margin-top: 0.5em !important;
      margin-bottom: 0.5em !important;
      padding-left: 0.375em !important;
    }
  }

  .code-block-wrapper {
    position: relative;
    
    &:hover {
      .copy-btn {
        opacity: 1;
      }
    }

    pre {
      hyphens: none;    text-align: left;
      white-space: pre;
      word-spacing: normal;margin: .5em 0;
      overflow: auto;
      word-break: normal;    background: #1d2936;
      word-wrap: normal;text-shadow: 0 1px rgba(0, 0, 0, 0.3);
      font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;

      code {
        color: #fff;
        text-align: start;
        direction: ltr;
        line-height: 1.8em;
        font-size: 1em;
        * {
          font-weight: normal;
        }

        .hljs-title {
          font-weight: normal;
          color: #e6db74;
        }

        .hljs-keyword {
          color: #66d9ef;
        }

        .hljs-string {
          color: #a6e22e;
        }

        .hljs-built_in {
          color: #66d9ef;
        }

        .hljs-number {
          color: #ae81ff;
        }
      }
    }
    
    .copy-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      background-color: var(--bg1);
      border: 1px solid var(--light-gray);
      color: var(--text-color);
      border-radius: 4px;
      padding: 4px 8px;
      font-size: 12px;
      font-family: var(--font);
      cursor: pointer;
      opacity: 0;
      transition: opacity 0.2s ease-in-out, background-color 0.2s, color 0.2s;
      display: flex;
      align-items: center;
      gap: 4px;

      .copy-svg, .done-svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
      }

      .material-icons {
        font-size: 14px;
      }
      
      &:hover {
        background-color: var(--bg2);
      }

      &.copied {
        background-color: rgba(76, 175, 80, 0.1);
        border-color: rgba(76, 175, 80, 0.5);
        color: var(--green);
      }
    }
  }

  // Headings
  h1, h2, h3, h4, h5, h6 {
    margin: 10px 0 6px 0;
    padding: 0;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-color);

    &:first-child {
      margin-top: 0;
    }
  }

  h1 {
    font-size: 20px;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 8px;
  }

  h2 {
    font-size: 18px;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 6px;
  }

  :deep(h3) {
    font-size: 1.25em;
    margin-bottom: 0.6em !important;
  }

  :deep(h4) {
    font-size: 15px;
    margin-bottom: 0.5em !important;
  }

  h5 {
    font-size: 14px;
  }

  h6 {
    font-size: 13px;
    font-style: italic;
  }

  // Paragraphs
  :deep(p) {
    margin: 8px 0;
    padding: 0;
    line-height: 1.55;

    &:first-child {
      margin-top: 0;
    }

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

  // Lists
  :deep(ul), :deep(ol) {
    margin: 10px 0;
    padding: 0 0 0 20px;
    line-height: 1.55;

  }
  :deep(li) {
    margin: 6px 0;
    padding: 0;
    line-height: inherit;
    margin-top: 0.5em !important;
    margin-bottom: 0.5em !important;
    padding-left: 0.375em !important;

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

  ul {
    // list-style-type: disc;

    ul {
      // list-style-type: circle;
      margin: 6px 0;
    }
  }

  ol {
    list-style-type: decimal;
  }

  // Code blocks
  pre {
    background: var(--bg2);
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    padding: 8px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre; // keep preformatting for blocks

    &.hljs {
      padding: 1em;
      border-radius: 8px;
    }

    code {
      background: transparent;
      padding: 0;
      border-radius: 0;
    }
  }

  // Inline code
  code {
    background: var(--bg2);
    border: 1px solid var(--light-gray);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-color);
    white-space: pre-wrap; // inline code can wrap
  }

  // Blockquotes
  blockquote {
    border-left: 3px solid var(--green);
    padding: 6px 12px;
    margin: 10px 0;
    font-style: italic;
    color: var(--gray);
    background: rgba(76, 175, 80, 0.05);
    border-radius: 3px;
  }

  // Links
  a {
    color: var(--green);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  // Tables
  table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    border: 1px solid var(--light-gray);

    th, td {
      border: 1px solid var(--light-gray);
      padding: 4px 8px;
      text-align: left;
    }

    th {
      background: var(--bg2);
      font-weight: 600;
    }

    tr:nth-child(even) {
      background: rgba(0, 0, 0, 0.02);
    }
  }

  // Horizontal rules
  hr {
    border: none;
    border-top: 1px solid var(--light-gray);
    margin: 14px 0;
  }

  // Strong and emphasis
  strong, b {
    font-weight: 600;
  }

  em, i {
    font-style: italic;
  }

  // Line breaks
  br {
    margin-bottom: 2px;
  }
}