:root {
  --ls-wb-stroke-color-gray: var(--color-gray-500, gray);
  --ls-wb-stroke-color-red: var(--color-red-500, red);
  --ls-wb-stroke-color-yellow: var(--color-yellow-500, yellow);
  --ls-wb-stroke-color-green: var(--color-green-500, green);
  --ls-wb-stroke-color-blue: var(--color-blue-500, blue);
  --ls-wb-stroke-color-purple: var(--color-purple-500, purple);
  --ls-wb-stroke-color-pink: var(--color-pink-500, pink);
  --ls-wb-stroke-color-default: var(--ls-secondary-border-color, hsl(var(--border, var(--rx-gray-05-hsl))));
  --ls-wb-text-color-default: var(--ls-primary-text-color, hsl(var(--primary)));
  --ls-wb-background-color-default: var(--ls-tertiary-background-color, var(--rx-gray-03));
}

.logseq-tldraw {
  --color-panel: var(--ls-tertiary-background-color, hsl(var(--secondary)));
  --color-panel-inverted: var(--ls-secondary-text-color);
  --color-text: var(--ls-primary-text-color);
  --color-text-inverted: var(--ls-tertiary-background-color);
  --color-hover: var(--ls-secondary-background-color, hsl(var(--secondary)));
  --color-selectedStroke: var(--ls-button-background, hsl(var(--accent) / 0.9));
  --color-selectedFill: hsl(var(--ls-button-background-hsl, var(--accent)) / 0.1);
  --color-selectedContrast: #fff;
  --shadow-small: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-medium: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-large: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  backface-visibility: hidden;
}

.logseq-tldraw *:not(.tl-logseq-portal-container) * {
  -webkit-touch-callout: none;
  user-select: none;
}

.logseq-tldraw .block-content-wrapper * {
  user-select: text;
}

.dark-theme,
html[data-theme='dark'] {
  --ls-wb-background-color-gray: var(--color-gray-800, gray);
  --ls-wb-background-color-red: var(--color-red-800, red);
  --ls-wb-background-color-yellow: var(--color-yellow-800, yellow);
  --ls-wb-background-color-green: var(--color-green-800, green);
  --ls-wb-background-color-blue: var(--color-blue-800, blue);
  --ls-wb-background-color-purple: var(--color-purple-800, purple);
  --ls-wb-background-color-pink: var(--color-pink-800);

  --ls-wb-text-color-gray: var(--color-gray-400, gray);
  --ls-wb-text-color-red: var(--color-red-400, red);
  --ls-wb-text-color-yellow: var(--color-yellow-400, yellow);
  --ls-wb-text-color-green: var(--color-green-400, green);
  --ls-wb-text-color-blue: var(--color-blue-400, blue);
  --ls-wb-text-color-purple: var(--color-purple-400, purple);
  --ls-wb-text-color-pink: var(--color-pink-400, pink);
}

.white-theme,
.light-theme,
html[data-theme='light'] {
  --ls-wb-background-color-gray: var(--color-gray-200, gray);
  --ls-wb-background-color-red: var(--color-red-200, red);
  --ls-wb-background-color-yellow: var(--color-yellow-200, yellow);
  --ls-wb-background-color-green: var(--color-green-200, green);
  --ls-wb-background-color-blue: var(--color-blue-200, blue);
  --ls-wb-background-color-purple: var(--color-purple-200, purple);
  --ls-wb-background-color-pink: var(--color-pink-200, pink);

  --ls-wb-text-color-gray: var(--color-gray-600, gray);
  --ls-wb-text-color-red: var(--color-red-600, red);
  --ls-wb-text-color-yellow: var(--color-yellow-600, yellow);
  --ls-wb-text-color-green: var(--color-green-600, green);
  --ls-wb-text-color-blue: var(--color-blue-600, blue);
  --ls-wb-text-color-purple: var(--color-purple-600, purple);
  --ls-wb-text-color-pink: var(--color-pink-600, pink);
}

.logseq-tldraw-wrapper {
  @apply flex flex-col w-full h-full relative;

  img {
    -webkit-user-drag: none;
  }
}

.color-input-wrapper {
  overflow: hidden;
  width: 24px;
  height: 24px;

  .color-input {
    transform: translate(-50%, -50%) scale(4);
  }
}

.tl-container {
  overflow: hidden;
  background-color: transparent !important;
}

#tl-zoom {
  @apply w-auto !important;
}

.tl-menu-item {
  @apply leading-[20px];
}

#zoomPopup .tl-menu-item {
  @apply pl-4 !important;
}

.tl-menu-button-row-wrap {
  @apply flex flex-col;
}

.tl-menu-button-row {
  @apply flex justify-between py-1 gap-[26px] opacity-80 hover:opacity-100;

  .ti {
    @apply text-lg;
  }
}

.tl-menu {
  @apply relative flex flex-col opacity-100 select-none;

  z-index: 180;
  min-width: 220px;
  pointer-events: 'all';
}

.tl-menu-icon {
  @apply text-[16px] leading-none opacity-70 mr-1;
}

.tl-menu-icon.ti-circle-dotted {
  @apply invisible;
}

.tl-menu-right-slot {
  margin-left: auto;
  padding-left: 20px;
  line-height: 1;

  .keyboard-shortcut > code {
    padding: 4px !important;
    text-rendering: initial;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
      'Courier New', monospace;
  }
}

.tl-menu-right-slot:focus {
  color: whites;
}

.tl-action-bar {
  @apply absolute flex items-center border-0 left-10 bottom-8 flex-wrap-reverse pr-12;

  z-index: 100000;
  user-select: none;
}

.tl-toolbar {
  @apply relative flex text-sm p-1 rounded-lg pointer-events-auto items-center
  shadow gap-1 z-50 whitespace-nowrap top-[-10%];

  background-color: var(--lx-gray-03, var(--ls-secondary-background-color, var(--rx-gray-03)));

  .ui__select-trigger.px-3 {
    @apply px-1.5 py-0 my-1 text-xs h-[32px];
  }
}

.tl-context-bar {
  gap: 8px;
  padding: 6px;

  label {
    font-family: var(--ls-font-family);
    font-size: 10px;
  }

  .input {
    @apply flex items-center;
    gap: 4px;
  }

  .number-input {
    width: 44px;
    height: 24px;
    padding: 2px;
  }

  .switch-input-root {
    all: unset;
    width: 36px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.44);
    position: relative;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    border-radius: 9999px;

    &[data-state='checked'] {
      background: #8ec2c2;
    }

    .switch-input-thumb {
      display: block;
      width: 16px;
      height: 16px;
      background-color: white;
      border-radius: 9999px;
      transition: transform 100ms ease 0s;
      transform: translateX(3px);
      will-change: transform;
    }

    &[data-state='checked'] .switch-input-thumb {
      transform: translateX(17px);
    }
  }

  .tl-text-input {
    height: 24px;
    padding: 0;
    background: none;
    border-radius: 2px;

    &:focus {
      outline: none;
    }
  }

  .tl-geometry-tools-pane-anchor > .tl-button {
    border: 1px solid var(--ls-secondary-border-color);
  }
}

.tl-statusbar {
  @apply absolute flex items-center w-full bottom-0;

  background: var(--ls-secondary-background-color);
  font-family: monospace;
  font-size: 10px;
  grid-row: 3;
  padding: 8px;
  z-index: 100000;
  user-select: none;
  flex-shrink: 0;
  height: 32px;
}

.tl-button {
  @apply relative flex items-center justify-center rounded border-0 gap-1 bg-none cursor-pointer;
  @apply w-[32px] h-[32px] hover:bg-gray-06;

  &[data-selected='true'] {
    @apply bg-accent text-accent-foreground;
  }
}

.tl-select-trigger {
  @apply h-8 font-medium bg-transparent px-3;

  border: 1px solid var(--ls-secondary-border-color);

  &.compact {
    @apply px-0 justify-center text-xs;
  }
}

.popper-arrow {
  fill: var(--ls-secondary-background-color);
}

.tl-primary-tools {
  @apply absolute h-full top-0 flex items-center justify-center;

  right: 30px;
  pointer-events: none;
  gap: 8px;
  z-index: 10000;
  flex-flow: column;
  border-radius: 8px;
  padding: 8px;

  .tl-button {
    font-size: 16px;
    flex: 0 0 auto;
  }
}

.tl-tools-floating-panel {
  flex-flow: column;

  .tl-select-input-trigger {
    @apply p-0 text-xs;

    height: 32px;
    min-width: 32px;
  }

  .tl-select-input-trigger-value {
    @apply font-semibold justify-center;
  }
}

button.tl-select-input-trigger {
  @apply flex items-center px-3;
  box-shadow: 0 0 0 1px var(--ls-secondary-border-color);
  background-color: var(--ls-secondary-background-color);
  border-radius: 0.25rem;
  font-size: 16px;
  height: 100%;
  color: var(--ls-secondary-text-color);
}

.tl-select-input-trigger-value {
  @apply flex items-center justify-start flex-1;
}

.tl-select-input-viewport {
  border-radius: 8px;
  background-color: var(--ls-secondary-background-color);
}

.tl-select-input-select-item {
  cursor: default;
  padding: 4px 12px;
  outline-offset: -1px;

  color: var(--ls-secondary-text-color);

  &[data-state='unchecked']:hover {
    background-color: var(--ls-tertiary-background-color);
    color: var(--ls-primary-text-color);
  }

  &[data-state='checked'] {
    background-color: or(--ls-whiteboard-select-background-selected, --lx-accent-09, --color-indigo-500);
    color: #fff;
  }
}

.tl-select-input-content {
  z-index: 100;
  font-family: var(--ls-font-family);
}

.tl-geometry-tools-pane-anchor {
  @apply relative;

  &[aria-expanded='true'] {
    .tl-popover-indicator {
      transform: rotate(180deg);
    }
  }
}

.tl-popover-indicator {
  @apply absolute text-2xs;

  opacity: 0.8;
  pointer-events: none;
  left: 0;
  bottom: -3px;

  &[data-selected='true'] {
    color: #000;
  }
}

.floating-panel[data-tool-locked='true'] > .tl-button[data-selected='true']::after {
  @apply block absolute;

  content: '';
  height: 6px;
  width: 6px;
  border: 2px solid var(--color-selectedContrast);
  background-color: var(--color-selectedFill);
  bottom: -4px;
  left: calc(50% - 5px);
  border-radius: 100%;
}

.tl-text-shape-wrapper {
  @apply absolute p-0 m-0 h-full w-full;

  white-space: pre-wrap;
  overflow-wrap: break-word;
  border: 1px solid transparent;
  z-index: 9999;
  user-select: none;
  min-height: 1;
  min-width: 1;
  line-height: 1;
  outline: 0;
  backface-visibility: hidden;
  pointer-events: all;
  vertical-align: baseline;
}

.tl-text-shape-input {
  @apply absolute inset-0 inline-block border-0 overflow-hidden;

  z-index: 1;
  resize: none;
  padding: inherit;
  font-family: inherit;
  font-size: inherit;
  font-variant: inherit;
  font-style: inherit;
  text-align: inherit;
  min-height: inherit;
  min-width: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  background-color: transparent;
  outline: 0;
  white-space: inherit;
  overflow-wrap: inherit;
  font-weight: inherit;
  backface-visibility: hidden;
  pointer-events: all;
  user-select: text;

  &:focus {
    outline: none;
    border: none;
    box-shadow: none;
  }
}

.tl-stroke-hitarea {
  fill: none;
  stroke: transparent;
  stroke-width: calc(24px * var(--tl-scale));
  pointer-events: stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-text-label-wrapper {
  @apply absolute inset-0 flex items-center justify-center;

  pointer-events: none;
  user-select: none;
  font-family: var(--ls-font-family);
}

.tl-text-label-inner-wrapper {
  position: absolute;
  padding: 6px 4px 4px;
  z-index: 1;
  min-height: 1px;
  min-width: 1px;
  line-height: 1;
  outline: 0;
  font-weight: 500;
  text-align: center;
  backface-visibility: hidden;
  user-select: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.tl-text-label-textarea {
  @apply absolute inset-0;

  z-index: 1;
  border: none;
  padding: 6px 4px 4px;
  resize: none;
  text-align: inherit;
  min-height: inherit;
  min-width: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  outline: 0;
  font-weight: inherit;
  overflow: hidden;
  backface-visibility: hidden;
  display: inline-block;
  pointer-events: all;
  background: transparent !important;
  user-select: text;
  -webkit-font-smoothing: subpixel-antialiased;
  white-space: pre-wrap;
  overflow-wrap: break-word;

  &:focus {
    outline: none;
    border: none;
    box-shadow: none;
    background-color: hsla(0, 0%, 50%, 0.15) !important;
  }
}

.tl-preview-minimap {
  height: 300px;
  width: 400px;

  /* Set top to be the viewport minus 10px */
  bottom: calc(100vh - 320px);

  left: 16px;
  position: absolute;
  border: 1px solid black;
  background-color: #fff;
  pointer-events: all;
}

.tl-preview-minimap-toggle {
  @apply absolute flex items-center justify-center text-sm;

  top: 60px;
  right: 50px;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  background: white;
  cursor: pointer;

  &[data-active='true'] {
    background: #eee;
  }
}

.tl-quick-search {
  width: fit-content;
  position: relative;
}

.tl-circle-button {
  @apply absolute flex items-center justify-center rounded-full shadow;

  color: var(--ls-primary-text-color);
  background-color: var(--ls-secondary-background-color);
  font-size: 22px;
  right: calc(100% + 12px);
  height: 34px;
  width: 34px;
  border: 2px solid var(--ls-secondary-background-color);
  top: 2px;

  .tie {
    transform: translateY(-100%);
  }

  .tl-circle-button-icons-wrapper {
    @apply flex flex-col;
  }
}

.tl-quick-search-input-container {
  @apply flex items-center rounded-lg text-base max-w-full;

  min-height: 40px;
  background-color: var(--ls-secondary-background-color, hsl(var(--background)));
  padding: 6px 16px;
  box-shadow: var(--shadow-small);
}

.tl-quick-search-input-filter {
  @apply flex items-center text-sm;

  background: rgba(0, 0, 0, 0.1);
  padding: 2px 8px;
  white-space: nowrap;
  gap: 8px;
  border-radius: 5px;
  margin-right: 8px;
}

.tl-quick-search-input-filter-remove {
  @apply flex items-center justify-center;

  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--ls-block-bullet-border-color);

  &:hover {
    background-color: rgba(0, 0, 0, 0.5) !important;
  }

  > i.ti {
    transform: translateY(-0.5px);
  }
}

.tl-input {
  position: relative;
}

.tl-input-sizer {
  position: relative;
}

.tl-text-input {
  @apply absolute inset-0;

  outline: none !important;
}

.tl-quick-search .tl-text-input {
  background-color: transparent;
  border: none;
}

.tl-input-hidden {
  white-space: pre;
  opacity: 0;
  min-height: 24px;
  min-width: 60px;
}

.tl-quick-search-input {
  min-width: 240px;
}

.tl-quick-search-options {
  @apply absolute left-0 w-full flex z-10;

  top: calc(100% + 12px);
  background-color: var(--ls-primary-background-color, hsl(var(--background)));
  max-height: 300px;
  min-width: 460px;
  box-shadow: var(--shadow-large);
  overflow-y: auto;
  flex-direction: column;
  border-radius: 8px;
  overscroll-behavior: none;
}

.tl-quick-search-option {
  @apply flex text-sm;

  flex-flow: column;
  padding: 8px 16px;
  cursor: pointer;
  gap: 0.5em;
  user-select: none;

  &[data-focused='true'] {
    background-color: var(--ls-menu-hover-color, var(--lx-gray-03, var(--rx-gray-03)));
  }
}

.tl-quick-search-option-row {
  @apply flex items-center;

  gap: 0.5em;

  .breadcrumb {
    margin: 0;
  }
}

.tl-quick-search-option-placeholder {
  width: 24px;
  flex-shrink: 0;
}

.tl-quick-search-option-breadcrumb {
  opacity: 0.5;
}

/* This will breaks block selection
[data-inner-events=false] * {
  user-select: none;
} */

.tl-logseq-portal-container {
  @apply flex flex-col rounded-lg absolute;

  top: 0;
  left: 0;
  overscroll-behavior: none;
  opacity: 1;
  user-select: text;
  transform-origin: top left;

  &[data-portal-selected='true'] {
    filter: brightness(0.9) contrast(0.5);
  }
}

.tl-logseq-portal-header {
  @apply relative flex items-center w-full;

  height: 40px;
  flex-shrink: 0;
  z-index: 1;
  color: var(--ls-title-text-color);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  padding: 0 1rem;
  gap: 0.5em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;

  .page-ref {
    color: var(--ls-title-text-color);
  }

  .breadcrumb {
    text-overflow: ellipsis;
    overflow: hidden;
    flex-wrap: nowrap;
  }

  .block-content {
    white-space: nowrap;
  }
}

.tl-logseq-cp-container-bg {
  border-radius: 8px;
}

.tl-type-tag {
  @apply flex items-center justify-center rounded text-base;

  flex-shrink: 0;
  width: 24px;
  height: 24px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  order: 0;
  flex-grow: 0;
}

.tl-image-shape-container {
  @apply h-full w-full overflow-hidden flex items-center justify-center pointer-events-auto;

  &[data-asset-loaded='false'] {
    background-color: var(--ls-secondary-background-color);
  }
}

.tl-html-container {
  @apply h-full w-full m-0 relative flex flex-col;
  user-select: text;
  transform-origin: top left;
}

.tl-iframe-container {
  @apply rounded-lg w-full h-full relative overflow-hidden shadow-xl;
  background-color: var(--ls-secondary-background-color);
}

.tl-html-anchor {
  width: fit-content;
}

.tl-html-anchor > iframe {
  @apply h-full w-full !important;
  margin: 0;
}

.tl-video-container {
  @apply h-full w-full m-0 relative;

  > video {
    @apply h-full w-full m-0 relative;
  }
}

.tl-logseq-cp-container {
  @apply relative h-full w-full rounded-lg;

  border-top-left-radius: 0;
  border-top-right-radius: 0;
  overscroll-behavior: none;
  flex: 1 1 0%;
  cursor: default;
}

.tl-highlighted {
  @apply p-0 rounded-none;
}

.tl-target-not-found {
  @apply flex h-full w-full items-center justify-center;
}

html[data-theme='light'] {
  .tl-quick-search-input-filter-remove {
    background-color: #7373734d;
  }

  .tl-type-tag[data-active='true'] {
    background: rgba(66, 133, 244, 0.2);
    border: 1px solid rgba(42, 123, 253, 0.5);
    color: var(--ls-secondary-text-color);
  }
}

html[data-theme='dark'] {
  .tl-type-tag[data-active='true'] {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                or(--ls-whiteboard-logseq-button-border, --lx-accent-09, #338fff);
    border: 1px solid or(--ls-whiteboard-logseq-button-border, --lx-accent-09, #338fff);
    color: var(--ls-secondary-text-color);
  }
}

.tl-toggle-group-input {
  @apply rounded overflow-hidden;
  box-shadow: 0 0 0 1px var(--ls-secondary-border-color);
}

.tl-toggle-group-input-button {
  @apply inline-flex items-center justify-center;
  border-right: 1px solid var(--ls-secondary-border-color);
  height: 32px;
  width: 32px;
  color: var(--ls-secondary-text-color);
  opacity: 0.3;

  &:last-of-type {
    border-right: none;
  }

  &:hover {
    background-color: var(--ls-tertiary-background-color);
  }

  &[data-state='on'] {
    background-color: var(--ls-tertiary-background-color);
    color: var(--ls-primary-text-color);
    opacity: 1;
  }
}

.tl-toggle-input {
  @apply inline-flex items-center justify-center;
  height: 32px;
  min-width: 32px;
  color: var(--ls-secondary-text-color);

  &:hover {
    background-color: var(--ls-tertiary-background-color);
  }

  &[data-state='on'] {
    background-color: var(--ls-tertiary-background-color);
    color: var(--ls-primary-text-color);
  }
}

.tl-toolbar-separator {
  background-color: var(--ls-border-color, var(--rx-gray-06));
  width: 1px;
  opacity: 0.9;

  &[data-orientation='horizontal'] {
    height: 1px;
    width: auto;
  }
}

.tl-youtube-link,
.tl-twitter-link,
.tl-iframe-src {
  @apply rounded-lg px-2 py-1;
  color: var(--ls-primary-text-color);
  box-shadow: 0 0 0 1px var(--ls-secondary-border-color);
}

.logseq-tldraw {
  .twitter-tweet,
  iframe {
    margin: 0 !important;
  }
}

.tl-hitarea-stroke {
  fill: none;
  stroke: transparent;
  pointer-events: stroke;
  stroke-width: min(100px, calc(12px * var(--tl-scale)));
}

.tl-hitarea-fill {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  stroke-width: min(100px, calc(12px * var(--tl-scale)));
}

.tl-popover-content {
  @apply rounded-lg;

  background-color: var(--ls-secondary-background-color);
  box-shadow: var(--shadow-large);
  z-index: 100000;
}

.tl-geometry-toolbar {
  box-shadow: none;
}

.tl-popover-arrow {
  fill: var(--ls-secondary-background-color);
}

.tl-color-palette {
  @apply grid grid-cols-4;
}

.tl-color-drip {
  @apply rounded text-sm;

  width: 32px;
  height: 32px;
  padding: 3px;
  border: 1px solid var(--ls-secondary-border-color);
  color: var(--ls-secondary-text-color);

  &.active {
    padding: 0;

    .tl-color-bg {
      border: 3px solid var(--ls-selection-background-color);
    }
  }
}

.tl-color-bg {
  @apply flex justify-center items-center w-full h-full rounded-sm;
}

.tl-slider-root {
  @apply relative flex items-center w-full rounded-sm;

  user-select: none;
  touch-action: none;
  background: url('../img/checker.png');
}

.tl-slider-track {
  @apply relative grow rounded-sm w-full;

  background: linear-gradient(90deg, transparent, var(--ls-tertiary-background-color));
  border: 1px solid var(--ls-secondary-border-color);

  &[data-orientation='horizontal'] {
    height: 10px;
  }

  &[data-orientation='vertical'] {
    width: 10px;
  }
}

.tl-slider-range {
  @apply absolute h-full rounded-sm;
}

.tl-slider-thumb {
  @apply block rounded-sm;

  width: 8px;
  height: 14px;
  background-color: var(--ls-secondary-background-color);
  border: 1px solid var(--color-selectedStroke);
  box-shadow: 0 0 1px var(--ls-secondary-border-color);

  &:hover {
    background-color: var(--ls-tertiary-background-color);
  }
}

.tl-backlinks-count-container {
  z-index: 10004;
}

.tl-backlinks-count {
  @apply inline-flex items-center justify-center p-1 transition-all;
  background-color: var(--color-selectedFill);

  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;

  &:hover,
  &.open {
    @apply p-1.5;
  }
}

.tl-backlinks-count-rounded {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  transform: translate(4px, -6px);

  &:hover,
  &.open {
    height: 36px;
    width: 36px;
  }
}

.tl-shape-links-count {
  @apply px-1 rounded-sm;
  background-color: var(--ls-page-properties-background-color);
}

.tl-shape-links-panel,
.tl-shape-links-reference-panel {
  @apply p-3 flex flex-col gap-2;
  min-width: 340px;
  max-width: 516px;
  color: var(--ls-primary-text-color);
}

.tl-shape-links-panel {
  @apply rounded-b-lg;
}

.tl-shape-links-reference-panel {
  @apply rounded-t-lg;
}

[data-show-reference-panel='false'] .tl-shape-links-panel {
  @apply rounded-t-lg;
}

.tl-shape-links-panel-item {
  @apply rounded py-1 px-4 pr-2 flex items-center justify-center gap-1;
  color: var(--color-text);

  .page-ref {
    color: var(--ls-title-text-color);
  }

  button {
    @apply text-left;
  }
}

button.tl-shape-links-panel-item-remove-button {
  @apply rounded-full w-6 h-6 min-w-0 -ml-4 flex-shrink-0;

  transform: translate(16px, -16px);

  background-color: var(--ls-primary-background-color);

  &:hover {
    background-color: var(--ls-tertiary-background-color);
  }
}

.tl-shape-links-panel-add-button {
  @apply w-full font-medium text-base h-[40px];
  background-color: var(--ls-secondary-background-color);
}

.tl-popover-trigger-button {
  @apply rounded text-sm;

  min-width: 32px;
  height: 32px;
  padding: 3px;
  color: var(--ls-secondary-text-color);

  &[data-border='true'] {
    border: 1px solid var(--ls-secondary-border-color);
  }

  &[data-state='open'] {
    background-color: var(--ls-tertiary-background-color);
    color: var(--ls-primary-text-color);
    opacity: 1;
  }
}

.tl-quick-links-container {
  z-index: 10005;
}

.tl-quick-links {
  @apply rounded text-sm w-fit;
  background-color: var(--ls-secondary-background-color);
}

.tl-quick-links-row {
  @apply flex;
  min-height: 26px;

  > button {
    @apply px-2 text-left;
  }

  .breadcrumb {
    margin: 0;
  }

  .page-ref {
    @apply flex-1;
  }

  * {
    color: inherit !important;
  }
}

.tl-quick-links-row:nth-child(1) {
  @apply rounded bg-indigo-600;
  background: or(--ls-whiteboard-quick-links-background, --lx-accent-09, --color-indigo-600);
  color: #fff;
}

.tl-quick-links-row:nth-child(2) {
  @apply opacity-50;
  color: var(--ls-secondary-text-color);

  &:hover {
    @apply opacity-100;
  }
}

.tl-quick-links:hover {
  .tl-quick-links-row:nth-child(1):not(:hover) {
    @apply opacity-50;
  }
  .tl-quick-links-row:nth-child(1):hover {
    background: or(--ls-whiteboard-quick-links-background-hover, --lx-accent-08, --color-indigo-500);
  }
}

.block-link-reference-row {
  @apply block;
}

.tl-tooltip-content {
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1;
  color: or(--ls-whiteboard-tooltip-text, --lx-gray-12, --ls-secondary-text-color);
  background-color: or(--ls-whiteboard-tooltip-background, --lx-gray-05, --ls-secondary-background-color);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  user-select: none;
  animation-duration: 700ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;

  &[data-state='delayed-open'] {
    animation-name: fadeIn;
  }
}

.tl-tooltip-arrow {
  fill: var(--ls-secondary-background-color);
}

.tl-locked {
  stroke-dasharray: calc(3px * var(--tl-scale)) calc(3px * var(--tl-scale));
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
