  :root {
    --primary-color: #c667ff;
    --secondary-color: #9d34d4;
    --background-color: #f5f5f7;
    --text-color: #1e293b;
    --light-grey: #e8ecef;
    --light-grey-dark: #dbe2ea;
    --card-background: #ffffff;
    --left-sidebar-width: 300px;
    --red: #dc3545;
    --red-dark: #B12836;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --primary-color: #59008e;
      --secondary-color: #7723a4;
      --background-color: #131515;
      --text-color: #CCC7C1;
      --light-grey: #232627;
      --light-grey-dark: #282b2d;
      --card-background: #181a1b;
      --red: #a51d2a;
      --red-dark: #8e202b;
    }
  }

  @font-face {
    font-family: 'Open Sans';
    src: url("/OpenSans-ExtraBold.ttf") format('truetype'), url("/OpenSans-ExtraBold.ttf") format('ttf');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  @font-face {
    font-family: "Open Sans";
    src: url("/OpenSans-ExtraBold.ttf") format("truetype"),
      url("/OpenSans-ExtraBold.ttf") format("ttf");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  @font-face {
    font-family: 'Open Runde';
    src: url('/img/fonts/open-runde/OpenRunde-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Bebas Neue';
    src: url('/img/fonts/Bebas_Neue/BebasNeue-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'PT Serif';
    src: url('/img/fonts/PT_Serif/PTSerif-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Roboto Mono';
    src: url('/img/fonts/Roboto_Mono/RobotoMono-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
  }

  @font-face {
    font-family: 'Montserrat';
    src: url('/img/fonts/Montserrat/Montserrat-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
  }


  @font-face {
    font-family: 'Indie Flower';
    src: url('/img/fonts/Indie_Flower/IndieFlower-Regular.ttf') format('truetype');
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
  }

  body {
    font-family: "SF Pro Text", 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
    margin: 0;
    padding: 0;
    background: var(--background-color);
    color: var(--text-color);
  }

  .header {
    background: var(--card-background);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 50px;
    z-index: 1000;
    box-sizing: border-box;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }

  @media (prefers-color-scheme: dark) {
    .header {
      background-color: rgba(24, 26, 27, 0.8);
    }
  }

  .action-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
  }

  @media (max-width: 650px) {
    .action-buttons {
      gap: 8px;
      margin-left: auto;
    }

    .action-button,
    .share-button {
      padding: 8px !important;
    }

    .viewer-title {
      width: calc(100vw - 200px);
      font-size: 1rem;
    }

    .share-button {
      margin-left: 0;
    }
  }

  .action-button {
    background: var(--card-background);
    border: none;
    cursor: pointer;
    padding: 7px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: all 0.2s;
    border-radius: 20px;
    height: 35px;
    box-sizing: border-box;
  }

  .action-button:hover {
    background: var(--background-color);
  }

  .share-button svg polyline {
    transition: transform 0.2s ease;
  }

  .share-button:hover svg polyline {
    transform: translateY(-1px);
  }

  .download-mindmap-btn svg polyline {
    transition: transform 0.2s ease;
  }

  .download-mindmap-btn:hover svg polyline {
    transform: translateY(1.5px);
  }

  .create-button {
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    transition: all 0.2s;
    color: #ffffff;
    border-radius: 20px;
    height: 36px;
    box-sizing: border-box;
  }

  .create-button:hover {
    background-color: transparent;
    color: var(--text-color);
  }

  #more-btn>svg {
    transition: all 0.2s ease;
  }

  #more-btn:hover>svg {
    transform: rotate(10deg);
  }

  .viewer-content {
    position: absolute;
    background-color: var(--background-color);
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
  }

  .viewer-content svg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    display: block;
    font-family: 300 16px/20px BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    ;
    font-weight: 300;
  }

  .viewer-content>svg>g>g>line {
    stroke-linecap: round;
  }

  .error-message {
    position: fixed;
    top: 70px;
    left: 50%;
    max-width: 228px;
    text-align: center;
    width: 90vw;
    transform: translateX(-50%);
    color: var(--red);
    font-weight: 500;
    padding: 10px 20px;
    background-color: rgba(220, 20, 60, 0.1);
    border-radius: 40px;
    display: none;
    z-index: 1001;
  }

  .logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 20px;
  }

  .logo {
    height: 30px;
    width: auto;
  }

  .viewer-title {
    font-size: 1.6rem;
    font-weight: 700;
    width: calc(100vw - 500px);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    text-align: left;
    left: 65px;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .legals-disclaimer {
    position: fixed;
    bottom: 10px;
    left: 0;
    opacity: 0.5;
    text-align: left;
    z-index: 500;
    background-color: var(--background-color);
    padding: 5px 10px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    color: var(--light-grey-dark);
    margin: 0 auto;
    font-family: "SF Pro Text", 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: 500;
  }

  .legals-disclaimer a {
    color: var(--primary-color);
    text-decoration: none;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
  }

  .legals-disclaimer a:hover {
    opacity: 0.6;
  }

  .copy-notification {
    position: fixed;
    top: 70px;
    left: 50%;
    width: 90vw;
    max-width: 269px;
    transform: translateX(-50%);
    background-color: var(--background-color);
    color: rgb(5, 255, 5);
    padding: 11px 24px;
    text-align: center;
    border: none;
    border-radius: 40px;
    width: 180px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  .copy-notification.show {
    opacity: 1;
  }

  @media (max-width: 650px) {
    .button-label {
      display: none;
    }
  }

  .legal-purposes {
    margin: 0;
    padding-left: 20px;
  }

  .popup-content a {
    background-color: #f0f0f0;
    padding: 3px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.1s ease;
    font-size: 1rem;
  }

  .popup-content a:hover {
    background-color: #e6e6e6;
  }

  .help-link {
    padding: 5px;
    border-radius: 10px;
    background-color: #f0f0f0;
    border: 1px solid #f0f0f0;
    text-decoration: none;
  }

  .help-link:hover {
    border: 1px solid #ddd;
  }

  .download-options-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.32);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
  }

.download-options-popup.show {
    opacity: 1;
    visibility: visible;
}

.download-options-popup-content {
    background-color: var(--white);
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -45%) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 28px;
    box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14),
        0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    padding: 24px;
}

.download-options-popup.show .download-options-popup-content {
    transform: translate(-50%, -50%) scale(1);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }

  .popup-header h2 {
    color: var(--text-color);
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0;
  }

  .close-button {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
  }

  .close-button:hover {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .close-button svg {
    fill: var(--text-color);
  }

  .download-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }

  .download-options-popup-content .popup-buttons button {
    flex: none !important;
  }

  .popup-buttons button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .print-button {
    background-color: var(--light-grey);
    color: var(--text-color);
    font-size: 1rem;
    border: 2px solid var(--light-grey);
    transition: all 0.2s ease;
    border-radius: 50%;
    height: 44px;
    width: 44px;
  }

  .print-button:hover {
    background-color: var(--light-grey-dark);
    border-color: var(--light-grey-dark);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  }

  .format-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .material-dropdown {
    width: 100%;
    padding: 12px 16px;
    border-radius: 40px;
    border: 2px solid var(--light-grey) !important;
    background-color: var(--white);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  }

  @media (prefers-color-scheme: dark) {
    .material-dropdown {
      background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22%2F%3E%3C%2Fsvg%3E");
    }
  }

  .material-dropdown:hover {
    border-color: var(--text-color);
  }

  .material-dropdown:focus {
    outline: none;
  }

  .download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  }

  .download-button {
    background-color: var(--primary-color);
    color: white;
    font-size: 1rem;
  }

  .download-button:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .share-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 0);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    z-index: 3200;
  }

  .share-dialog.active {
    transform: translate(-50%, -50%);
    opacity: 1;
    visibility: visible;
  }

  .share-dialog h3 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 0;
  }

  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
  }

  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  .share-dialog p {
    text-align: left;
    margin: 10px 0;
    color: var(--text-color);
  }

  .share-link-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 1rem;
  }

  .share-link {
    width: 96%;
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    border: 2px solid var(--light-grey);
    border-radius: 20px;
    font-size: 1rem;
    background: var(--background-color);
    color: var(--text-color);
    padding-right: 3rem;
  }

.share-link:focus, .share-link:active {
  outline: none;
  border-color: var(--primary-color);
}

.copy-link-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background-color 0.2s, color 0.2s;
  font-size: 0.85rem;
  font-weight: 500;
}

.copy-link-btn:hover {
  background-color: var(--light-grey);
  color: var(--primary-color);
}

.copy-link-btn svg {
  width: 16px;
  height: 16px;
}

  .qr-code-container {
    display: none;
    margin: 1rem auto;
    text-align: center;
  }

  .qr-code-container canvas {
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .qr-code-container:hover canvas {
    transform: scale(1.05);
  }

  .qr-code-container-hr {
    display: none;
  }

  @media (min-width: 769px) {
    .qr-code-container {
      display: block;
    }

    .qr-code-container-hr {
      display: block;
    }
  }

  /* QR Code Fullscreen Overlay */
  .qr-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: background-color 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  .qr-fullscreen-overlay.show {
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 1;
    visibility: visible;
  }

  .qr-fullscreen-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.5);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .qr-fullscreen-overlay.show .qr-fullscreen-container {
    transform: scale(1);
    opacity: 1;
  }

  .qr-fullscreen-close {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
  }

  .qr-fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
  }

  .qr-fullscreen-close svg {
    width: 20px;
    height: 20px;
    stroke: white;
    stroke-width: 2;
  }

  .qr-fullscreen-canvas {
    border-radius: 20px;
    background: white;
    padding: 20px;
  }

  .qr-fullscreen-canvas canvas {
    display: block;
    border-radius: 10px;
  }

  .share-button img {
    display: block;
    margin: 0;
  }

  .share-button:hover {
    background-color: var(--background-color) !important;
  }

  .dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .dialog-button {
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
      "Helvetica Neue", Arial, "Avenir", "Montserrat", "Corbel", "URW Gothic",
      "Source Sans Pro", sans-serif;
    font-weight: 500;
  }

  .dialog-button.cancel {
    background-color: var(--background-color);
    color: var(--text-color);
  }

  .dialog-button.cancel:hover {
    background-color: var(--background-color);
  }

  .dialog-button.confirm {
    background-color: var(--primary-color);
    color: white;
  }

  .dialog-button.confirm:hover {
    background-color: var(--secondary-color);
  }

  .dialog-button.danger {
    background-color: var(--red);
    color: white;
  }

  .dialog-button.danger:hover {
    background-color: var(--red-dark);
  }

  .dialog-button.danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  #mindmap {
    width: 100%;
    height: 100%;
    display: block;
  }

  #mindmap svg path {
    stroke-opacity: 1 !important;
    fill-opacity: 1 !important;
  }

  #svg-output > svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

  #svg-output svg.appearing .mm-stage {
    transform-origin: 50% 50%;
    animation: mmwPopIn 0.4s cubic-bezier(0.1, 0.1, 0.2, 1) both;
    will-change: transform, opacity;
  }

  @keyframes mmwPopIn {
    0% {
      transform: translate(-40%, -40%) scale(0.0005);
      opacity: 0;
    }

    100% {
      transform: translate(0, 0) scale(1);
      opacity: 1;
    }
  }