.navigation-controls {
  .topic-drafts-menu-trigger {
    display: none;
  }
}

.has-ai-conversations-sidebar {
  .sidebar-new-topic-button__wrapper {
    display: none;
  }
}

.sidebar-new-topic-button {
  flex: 1 1 auto;

  &__wrapper {
    box-sizing: border-box;
    display: flex;
    border-radius: 6.25em;
    margin-top: 4px; // hover & focus effect visibility

    &:focus-visible,
    &:hover {
      .discourse-no-touch & {
        background-color: var(--accent-color);
        box-shadow: 0 0 0 4px var(--button-box-shadow);
        color: var(--accent-text-color);

        .d-icon {
          color: var(--accent-text-color);
        }
      }
    }

    .mobile-view & {
      margin: 0 0 1rem;
    }

    &:has(.topic-drafts-menu-trigger) {
      .sidebar-new-topic-button {
        border-radius: var(--d-button-border-radius) 0 0
          var(--d-button-border-radius);
        border-right: 1px solid
          light-dark(
            oklch(from var(--primary-300) l c h),
            oklch(from var(--primary-700) l c h)
          ) !important;

        &:focus-visible,
        &:hover {
          .discourse-no-touch & {
            box-shadow: none;
            background: light-dark(
              oklch(from var(--accent-color) 40% c h),
              oklch(from var(--accent-color) 50% c h)
            );
          }
        }
      }
    }

    .fk-d-button-tooltip {
      flex: 1 1 auto;
    }

    .topic-drafts-menu-trigger {
      flex: 0 1 auto;
      margin: 0;
      border-radius: 0 var(--d-button-border-radius)
        var(--d-button-border-radius) 0;

      &:focus-visible,
      &:hover {
        .discourse-no-touch & {
          box-shadow: none;
          background: light-dark(
            oklch(from var(--accent-color) 40% c h),
            oklch(from var(--accent-color) 50% c h)
          );
        }
      }
    }

    .fk-d-button-tooltip:has(button[disabled]) {
      + .topic-drafts-menu-trigger {
        display: none;
      }

      .fk-d-tooltip__trigger {
        background: var(--accent-color);
        border-radius: 0 var(--d-button-border-radius)
          var(--d-button-border-radius) 0;
        padding-right: 0.65em;

        .d-icon {
          color: var(--secondary);
        }
      }
    }
  }
}

li.sidebar-section-link-wrapper[data-list-item-name="New Topic"] {
  display: none;
}

.has-full-page-chat {
  .sidebar-new-topic-button__wrapper {
    display: none;
  }
}
